Skip to content

Commit 7cf0e93

Browse files
committed
Merge pull request #1178 from bf4/opt_out_capturing_stderr_warnings
env CAPTURE_STDERR=false lets devs see hard failures
2 parents 7c82258 + 2e72223 commit 7cf0e93

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_helper.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@ def Minitest.after_run(&block)
3838
end
3939
end
4040

41-
require 'capture_warnings'
42-
CaptureWarnings.new(_fail_build = true).execute!
41+
# If there's no failure info, try disabling capturing stderr:
42+
# `env CAPTURE_STDERR=false rake`
43+
# This is way easier than writing a Minitest plugin
44+
# for 4.x and 5.x.
45+
if ENV['CAPTURE_STDERR'] !~ /false|1/i
46+
require 'capture_warnings'
47+
CaptureWarnings.new(_fail_build = true).execute!
48+
end
4349

4450
require 'active_model_serializers'
4551

0 commit comments

Comments
 (0)