Skip to content

Commit

Permalink
Fix broken test since minitest v5.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
y-yagi committed Mar 4, 2024
1 parent 019d1a6 commit d977b24
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/minitest/retry_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit d977b24

Please sign in to comment.