Method: RScout.capture_stdout
- Defined in:
- lib/rscout.rb
.capture_stdout(&block) ⇒ Object
156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/rscout.rb', line 156 def capture_stdout(&block) previous_stdout, $stdout = $stdout, StringIO.new yield if $stdout.respond_to?(:string) $stdout.string else logger.warn "Test suite hijacked our STDOUT capture." nil end ensure $stdout = previous_stdout end |