Module: OutputSilencer

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

Instance Method Summary collapse

Instance Method Details

#silence_stdoutObject



273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'opal/lib/mspec/opal/runner.rb', line 273

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