Module: OutputSilencer

Defined in:
opal/lib/mspec/opal/runner.rb

Instance Method Summary collapse

Instance Method Details

#silence_stdoutObject



236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'opal/lib/mspec/opal/runner.rb', line 236

def silence_stdout
  original_stdout = $stdout
  new_stdout = IO.new
  new_stdout.extend IO::Writable
  new_stdout.write_proc = ->s{}

  begin
    $stdout = new_stdout
    yield
  ensure
    $stdout = original_stdout
  end
end