summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--spec/spec_helper.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 82b6100..d93bff8 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,4 +6,18 @@ RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
+
+ # Silence output when running tests
+ original_stderr = $stderr
+ original_stdout = $stdout
+ config.before(:all) do
+ # Redirect stderr and stdout
+ $stderr = File.open(File::NULL, "w")
+ $stdout = File.open(File::NULL, "w")
+ end
+ config.after(:all) do
+ # Restore
+ $stderr = original_stderr
+ $stdout = original_stdout
+ end
end