Skip to content

Commit

Permalink
silence CLI output during tests
Browse files Browse the repository at this point in the history
this was 'dirtying' the test output unnecessarily
  • Loading branch information
Dorian Karter committed Apr 8, 2015
1 parent 13ce4e8 commit b1da10f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/test_helper.rb
Expand Up @@ -3,4 +3,19 @@
require 'ripper'
require 'fakefs/spec_helpers'

# silence CLI output
RSpec.configure do |config|
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
$stderr = original_stderr
$stdout = original_stdout
end
end

Dir["#{Dir.pwd}/spec/support/**/*.rb"].each { |f| require f }

0 comments on commit b1da10f

Please sign in to comment.