Files
codeocean/spec/support/silencer.rb
2015-02-07 10:19:36 +01:00

9 lines
167 B
Ruby

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