Skip to content

Instantly share code, notes, and snippets.

@caius
Created June 12, 2024 16:33
Show Gist options
  • Save caius/1bdd2bef31205c863712d5f9588775a8 to your computer and use it in GitHub Desktop.
Save caius/1bdd2bef31205c863712d5f9588775a8 to your computer and use it in GitHub Desktop.
require "rspec/autorun"
RSpec.describe "exceptional tekin" do
after(:each) do |example|
p example, example.exception
end
it "passes" do
expect(1).to eq(1) # duh
end
it "fails" do
expect(1).to eq(5) # uh oh
end
end
__END__
#<RSpec::Core::Example "passes">
nil
.#<RSpec::Core::Example "fails">
#<RSpec::Expectations::ExpectationNotMetError:"\nexpected: 5\n got: 1\n\n(compared using ==)\n">
F
Failures:
1) exceptional tekin fails
Failure/Error: Unable to find - to read failed line
expected: 5
got: 1
(compared using ==)
# -:13:in `block (2 levels) in <main>'
Finished in 0.00902 seconds (files took 0.0518 seconds to load)
2 examples, 1 failure
Failed examples:
rspec -:12 # exceptional tekin fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment