github-app/spec/spec_helper.rb
def capture_output
  original_stdout = $stdout.dup
  output_catcher = StringIO.new
  $stdout = output_catcher
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  output_catcher.string
end
# Captures the output into a container and returns as a string. Commandline programs
# note these will be available all the time. look for slowness.
Captures the output into a container and returns as a string. Commandline programs
note these will be available all the time. look for slowness.
Captures the output into a container and returns as a string . Commandline programs note these will be available all the time . look for slowness .
def capture_output
  original_stdout = $stdout.dup
  output_catcher = StringIO.new
  $stdout = output_catcher
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  output_catcher.string
end
def capture_output original_stdout = $stdout . dup output_catcher = StringIO . new $stdout = output_catcher begin yield ensure $stdout = original_stdout end output_catcher . string end
Captures the output into a container and returns as a string.
Captures the output into a container and returns as a string .