Created
May 28, 2017 18:29
-
-
Save myronmarston/bfcdd5c9adcb51b5c3e31603d884afd6 to your computer and use it in GitHub Desktop.
How to make RSpec fail if anything outputs
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
RSpec::Matchers.define_negated_matcher :avoid_outputting, :output | |
RSpec.configure do |config| | |
config.around do |ex| | |
expect(&ex).to avoid_outputting.to_stdout.and avoid_outputting.to_stderr | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment