I've refactored and committed https://github.com/serverspec/specinfra/pull/121#discussion_r13134218 pattern!