test/test_helper.rb
# Redirect standard out, standard error and the buffered logger for sprinkle to StringIO
# capture_stdout { any_commands; you_want } => "all output from the commands"
Redirect standard out, standard error and the buffered logger for sprinkle to StringIO
capture_stdout { any_commands; you_want } => "all output from the commands"
Redirect standard out standard error and the buffered logger for sprinkle to StringIO capture_stdout { any_commands ; you_want } = > " all output from the commands "
def capture_stdout
    return yield if ENV['DEBUG'] 
    out = StringIO.new
    $stdout = out
    $stderr = out
    yield
    return out.string
  ensure
    $stdout = STDOUT
    $stderr = STDERR
  end
def capture_stdout return yield if ENV [ 'DEBUG' ] out = StringIO . new $stdout = out $stderr = out yield return out . string ensure $stdout = STDOUT $stderr = STDERR end
Redirect standard out, standard error and the buffered logger for sprinkle to StringIO
capture_stdout { any_commands; you_want } => "all output from the commands"
Redirect standard out standard error and the buffered logger for sprinkle to StringIO capture_stdout { any_commands ; you_want } = > " all output from the commands "
# Skip if debug mode