Skip to content

Commit a088cc8

Browse files
authored
Merge pull request #437 from ruby/rwstauner/test-warnings
Silence warnings created by tests
2 parents 5ad0531 + cdb1da4 commit a088cc8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/benchmark_runner_test.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,18 @@
9191
end
9292

9393
it 'exits when file does not exist' do
94-
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init('/nonexistent/file.rb') }
94+
out = capture_io do
95+
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init('/nonexistent/file.rb') }
96+
end
97+
assert_includes out, "--with-pre-init called with non-existent file!\n"
9598
end
9699

97100
it 'exits when path is a directory' do
98101
Dir.mktmpdir do |dir|
99-
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init(dir) }
102+
out = capture_io do
103+
assert_raises(SystemExit) { BenchmarkRunner.expand_pre_init(dir) }
104+
end
105+
assert_includes out, "--with-pre-init called with a directory, please pass a .rb file\n"
100106
end
101107
end
102108
end

0 commit comments

Comments
 (0)