Sha256: 66d6f0f436843107659d4cbf7edbf4ebe51e34018e5dbe8aae3f43b72dd3e3f3
Contents?: true
Size: 776 Bytes
Versions: 44
Compression:
Stored size: 776 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
44 entries across 34 versions & 6 rubygems