silence standard output during RSpec runs
This commit is contained in:
8
spec/support/silencer.rb
Normal file
8
spec/support/silencer.rb
Normal 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
|
Reference in New Issue
Block a user