Fix failing test due to the relative path output of minitest

minitest has been updated to output relative paths for failures at v5.21.0

e410bade17

This patch fixes test to pass regardless of minitest versions.
This commit is contained in:
Takumasa Ochi 2024-01-12 21:27:54 +09:00
parent a255742b2e
commit 5853ff19eb
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

@ -73,7 +73,7 @@ def test_output_inline_by_default
create_test_file "post", pass: false
output = run_test_command("test/post_test.rb")
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test.rb:6\]:\nwups!\n\nbin/test (/private)?#{plugin_path}/test/post_test.rb:4}
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[.*?test/post_test.rb:6\]:\nwups!\n\nbin/test (/private)?#{plugin_path}/test/post_test.rb:4}
assert_match expect, output
end

@ -27,7 +27,7 @@ def test_rerun_snippet_is_relative_path
create_test_file "post", pass: false
output = run_test_command("test/post_test.rb")
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test\.rb:6\]:\nwups!\n\nbin/rails test test/post_test\.rb:4}
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[.*?test/post_test\.rb:6\]:\nwups!\n\nbin/rails test test/post_test\.rb:4}
assert_match expect, output
end