Skip to content

Commit

Permalink
Make with_info_handler take rest args to fix upstream arity change
Browse files Browse the repository at this point in the history
The upstream `with_info_handler` method was changed to take an extra parameter, which is now breaking the implementation of the method in this gem. This commit fixes the issue by making the method take rest arguments, which will allow it to work with the upstream changes, and any other positional arguments that might be added in the future.
  • Loading branch information
paracycle committed Aug 14, 2024
1 parent a51420b commit cf967ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/minitest/hooks/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def new(name)
# When running the specs in the class, first create a singleton instance, the singleton is
# used to implement around_all/before_all/after_all hooks, and each spec will run as a
# dup of the singleton instance.
def with_info_handler(reporter, &block)
def with_info_handler(*args, &block)
@instance = new(NEW)
@instance.time = 0
@instance.name = "around_all"


reporter, *_ = args

begin
@instance.around_all do
begin
Expand All @@ -78,7 +80,7 @@ def with_info_handler(reporter, &block)
failed = true
_record_minitest_hooks_error(reporter, @instance)
else
super(reporter, &block)
super
end
ensure
@instance.capture_exceptions do
Expand Down

0 comments on commit cf967ab

Please sign in to comment.