test/unit/expectation_test.rb in hardmock-1.3.7 vs test/unit/expectation_test.rb in hardmock-1.3.8
- old
+ new
@@ -249,11 +249,15 @@
a_block = lambda { things << 'WUP' }
err = assert_raise ExpectationError do
se.apply_method_call(@mock,'each_bean',[:side_slot],a_block)
end
+
+ expected_arity = "-1"
+ expected_arity = "0" if RUBY_VERSION =~ /^1\.9/
+
assert_match(/wont_fit/i, err.message)
- assert_match(/arity -1/i, err.message)
+ assert_match(/arity #{expected_arity}/i, err.message)
assert_equal [], things, "Wrong things"
end
def test_yields_with_returns
se = Expectation.new(:mock => @mock, :method => 'each_bean', :arguments => [:side_slot] ,