silence standard output during RSpec runs

This commit is contained in:
Hauke Klement
2015-02-07 10:19:36 +01:00
parent 2d1d06a31c
commit 3118158946
2 changed files with 11 additions and 1 deletions

8
spec/support/silencer.rb Normal file
View File

@ -0,0 +1,8 @@
module Silencer
def silenced
@stdout = $stdout
$stdout = File.new(File.join('tmp', 'stdout'), 'w')
yield if block_given?
$stdout = @stdout
end
end