Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to support ruby 3.0 #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/flexmock/composite_expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/partial_mock_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 #<#<Class:/ === exception.message,
"expected #{exception.message} to match /undefined method `does_not_exist' for #<#<Class:/")
end

def test_it_checks_whether_mocks_are_forbidden_before_forwarding_the_call
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def assert_failure(klass, options={}, &block)
# added.
def assert_mock_failure(klass, options={}, &block)
ex = assert_failure(klass, options, &block)
file = eval("__FILE__", block.binding)
file = block.binding.source_location.first
assert_matching_line(ex, file, options)
end

Expand Down