diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a0930085..f35cf55d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,4 +6,15 @@ c.include Helpers c.color = true c.formatter = :documentation if ENV["USE_REPORTERS"] + original_stderr = $stderr + original_stdout = $stdout + c.before(:all) do + # Redirect stderr and stdout + $stderr = File.open(File::NULL, "w") + $stdout = File.open(File::NULL, "w") + end + c.after(:all) do + $stderr = original_stderr + $stdout = original_stdout + end end