From d977b24dc0a0dd1181bc34adbd6a89d167f94b5e Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Mon, 4 Mar 2024 19:56:36 +0900 Subject: [PATCH] Fix broken test since minitest v5.21.0 minitest outputs relative path now https://github.com/minitest/minitest/blob/master/History.rdoc#label-5.21.0+-2F+2024-01-11 --- test/minitest/retry_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/minitest/retry_test.rb b/test/minitest/retry_test.rb index 81cef7e..7b3b1f0 100644 --- a/test/minitest/retry_test.rb +++ b/test/minitest/retry_test.rb @@ -47,10 +47,12 @@ def fail end Minitest::Runnable.run_one_method(retry_test, :fail, self.reporter) end + + path = Gem::Version.new(Minitest::VERSION) >= Gem::Version.new("5.21.0") ? "test/minitest/retry_test.rb" : __FILE__ expect = <<-EOS -[MinitestRetry] retry 'fail' count: 1, msg: RuntimeError: parsing error\n #{__FILE__}:45:in `fail' -[MinitestRetry] retry 'fail' count: 2, msg: RuntimeError: parsing error\n #{__FILE__}:45:in `fail' -[MinitestRetry] retry 'fail' count: 3, msg: RuntimeError: parsing error\n #{__FILE__}:45:in `fail' +[MinitestRetry] retry 'fail' count: 1, msg: RuntimeError: parsing error\n #{path}:45:in `fail' +[MinitestRetry] retry 'fail' count: 2, msg: RuntimeError: parsing error\n #{path}:45:in `fail' +[MinitestRetry] retry 'fail' count: 3, msg: RuntimeError: parsing error\n #{path}:45:in `fail' EOS refute reporter.passed?