Sha256: 4aec6c58d7270b117679ee7c8df7a0031bc03d823cf86165f74352ebdd89d5f4
Contents?: true
Size: 782 Bytes
Versions: 18
Compression:
Stored size: 782 Bytes
Contents
module ShouldaMacros # # Simple block helper for running certain tests only on specific ruby versions. # The given strings will be regexp-matched against RUBY_VERSION # def on_ruby(*ruby_versions) context "On Ruby #{RUBY_VERSION}" do yield end if ruby_versions.any? {|v| RUBY_VERSION =~ /#{v}/ } end def should_be(boolean_flag) should "be #{boolean_flag}" do assert_equal true, subject.send(boolean_flag) end end def should_not_be(boolean_flag) should "not be #{boolean_flag}" do assert_equal false, subject.send(boolean_flag) end end def should_have(attr_name, expectation) should "have #{attr_name} == #{expectation.inspect}" do assert_equal expectation, subject.send(attr_name) end end end
Version data entries
18 entries across 18 versions & 2 rubygems