Skip to content

Instantly share code, notes, and snippets.

@JunichiIto
Created June 15, 2017 01:43
Show Gist options
  • Save JunichiIto/6690a868137721c6b869f9e086d179d6 to your computer and use it in GitHub Desktop.
Save JunichiIto/6690a868137721c6b869f9e086d179d6 to your computer and use it in GitHub Desktop.
Check exception presence in after hook
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