Skip to content

Instantly share code, notes, and snippets.

@JScott
Created February 24, 2015 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JScott/791eddee7a8ba9c6bc03 to your computer and use it in GitHub Desktop.
Save JScott/791eddee7a8ba9c6bc03 to your computer and use it in GitHub Desktop.
I always forget how to hide output and logging with RSpec. This worked for me in the past.
module StdoutHelper
def hide_stdout
allow(STDOUT).to receive(:puts)
logger = double('Logger').as_null_object
allow(Logger).to receive(:new).and_return(logger)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment