Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions test/benchmark_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@
end

it 'exits when file does not exist' do
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init('/nonexistent/file.rb') }
out = capture_io do
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init('/nonexistent/file.rb') }
end
assert_includes out, "--with-pre-init called with non-existent file!\n"
Copy link
Contributor Author

@rwstauner rwstauner Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really care if we assert these or just ignore them but it's a pet peeve of mine to have the test output broken up by uncaught warnings (especially when they are properly induced by the test code).

end

it 'exits when path is a directory' do
Dir.mktmpdir do |dir|
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init(dir) }
out = capture_io do
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init(dir) }
end
assert_includes out, "--with-pre-init called with a directory, please pass a .rb file\n"
end
end
end
Expand Down
Loading