From cf967ab8127affcb0c56f6d59c7ddc9bacf0ca70 Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Thu, 15 Aug 2024 00:10:15 +0300 Subject: [PATCH] Make `with_info_handler` take rest args to fix upstream arity change 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. --- lib/minitest/hooks/test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/minitest/hooks/test.rb b/lib/minitest/hooks/test.rb index b14f46f..c08ba67 100644 --- a/lib/minitest/hooks/test.rb +++ b/lib/minitest/hooks/test.rb @@ -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 @@ -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