Skip to content

Instantly share code, notes, and snippets.

@daytonn
Created May 27, 2011 01:39
Show Gist options
  • Save daytonn/994490 to your computer and use it in GitHub Desktop.
Save daytonn/994490 to your computer and use it in GitHub Desktop.
Supress Output
def suppress_output(&block)
original_stdout = $stdout
$stdout = fake = StringIO.new
begin
yield
ensure
$stdout = original_stdout
end
fake.string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment