Created
February 24, 2015 23:27
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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