Skip to content

Commit

Permalink
Add more ruby2_keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabigeek committed Aug 25, 2022
1 parent c1d3b2c commit 96e71ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/mocha/invocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def initialize(mock, method_name, *arguments, &block)
@yields = []
@result = nil
end
ruby2_keywords(:initialize) if RUBY_V3_PLUS

def call(yield_parameters = YieldParameters.new, return_values = ReturnValues.new)
yield_parameters.next_invocation.each do |yield_args|
Expand Down
1 change: 1 addition & 0 deletions lib/mocha/stubbed_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def define_new_method
stub_method_owner.send(:define_method, method_name) do |*args, &block|
self_in_scope.mock.method_missing(method_name_in_scope, *args, &block)
end
stub_method_owner.send(:ruby2_keywords, method_name) if RUBY_V3_PLUS
retain_original_visibility(stub_method_owner)
end

Expand Down

0 comments on commit 96e71ad

Please sign in to comment.