Created
June 15, 2017 01:43
-
-
Save JunichiIto/6690a868137721c6b869f9e086d179d6 to your computer and use it in GitHub Desktop.
Check exception presence in after hook
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.describe 'Sample' do | |
after do |example| | |
if example.exception | |
puts 'Error!' | |
else | |
puts 'OK!' | |
end | |
end | |
example 'sample' do | |
expect(1 + 1).to eq 3 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment