diff --git a/lib/flexmock/composite_expectation.rb b/lib/flexmock/composite_expectation.rb index 370046f..fbc8e54 100644 --- a/lib/flexmock/composite_expectation.rb +++ b/lib/flexmock/composite_expectation.rb @@ -16,9 +16,9 @@ def add(expectation) end # Apply the constraint method to all expectations in the composite. - def method_missing(sym, *args, &block) + def method_missing(sym, *args, **keywords, &block) @expectations.each do |expectation| - expectation.send(sym, *args, &block) + expectation.send(sym, *args, **keywords, &block) end self end diff --git a/test/partial_mock_test.rb b/test/partial_mock_test.rb index 065ecb5..3564db3 100644 --- a/test/partial_mock_test.rb +++ b/test/partial_mock_test.rb @@ -634,7 +634,8 @@ def test_partial_mocks_leaves_NoMethodError_exceptions_raised_by_the_original_me exception = assert_raises(NameError) do obj.mocked_method end - assert_equal "undefined method `does_not_exist' for #{obj}", exception.message + assert(/undefined method `does_not_exist' for #<#