jobs/spec/samples_spec.rb
# Capture and return STDOUT output by block
Capture and return STDOUT output by block
Capture and return STDOUT output by block
def capture
    real_stdout = $stdout
    $stdout = StringIO.new
    yield
    @captured_output = $stdout.string
  ensure
    $stdout = real_stdout
  end
def capture real_stdout = $stdout $stdout = StringIO . new yield @captured_output = $stdout . string ensure $stdout = real_stdout end
Capture and return STDOUT output by block
Capture and return STDOUT output by block