Module: OutputSilencer
- Defined in:
- opal/lib/mspec/opal/runner.rb
Instance Method Summary collapse
Instance Method Details
#silence_stdout ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'opal/lib/mspec/opal/runner.rb', line 177 def silence_stdout original_stdout = $stdout new_stdout = IO.new new_stdout.extend IO::Writable def new_stdout.write(string) end begin $stdout = new_stdout yield ensure $stdout = original_stdout end end |