Skip to content

Commit

Permalink
- ! Unfixed deprecation warning fix that broke in nearly every other …
Browse files Browse the repository at this point in the history
…version of ruby. Only warns on 2.7, not 3.0 or others.

[git-p4: depot-paths = "//src/minitest/dev/": change = 13020]
  • Loading branch information
zenspider committed Feb 15, 2021
1 parent 9eb312b commit dfbde40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/minitest/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def stub name, val_or_callable, *block_args

metaclass.send :alias_method, new_name, name

metaclass.send :define_method, name do |*args, **kwargs, &blk|
metaclass.send :define_method, name do |*args, &blk|
if val_or_callable.respond_to? :call then
val_or_callable.call(*args, **kwargs, &blk)
val_or_callable.call(*args, &blk)
else
blk.call(*block_args) if blk
val_or_callable
Expand Down

0 comments on commit dfbde40

Please sign in to comment.