Module: OutputSilencer

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

Instance Method Summary collapse

Instance Method Details

#silence_stdoutObject



177
178
179
180
181
182
183
184
185
186
187
# File 'opal/lib/mspec/opal/runner.rb', line 177

def silence_stdout
  original_stdout = $stdout
  new_stdout = Object.new
  `#{new_stdout}.$puts = function(){}`
  begin
    $stdout = new_stdout
    yield
  ensure
    $stdout = original_stdout
  end
end