access the exception object of an rspec test

Developer from somewhere

Add an after hook like this:

after(:each) do |ex|
  if ex.example.exception
    # do smth here
  end
end