Class: OutputUtils

Inherits:
Object
  • Object
show all
Defined in:
app/utils/output_utils.rb

Class Method Summary collapse

Class Method Details

.with_captured_stdoutObject



2
3
4
5
6
7
8
9
# File 'app/utils/output_utils.rb', line 2

def self.with_captured_stdout
  original_stdout = $stdout
  $stdout = StringIO.new
  yield
  $stdout.string
ensure
  $stdout = original_stdout
end