support for Ruby 2.0
Extract test helpers into module for reuse