Skip to content

Commit

Permalink
Make sure runtime errors are outputted
Browse files Browse the repository at this point in the history
Resolves #40
  • Loading branch information
ilyazub committed Jun 4, 2024
1 parent 84f2487 commit 6455e65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fixtures/rspec/no_method_error_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RSpec.describe "NoMethodError spec" do
it("fails") { expect(nil[:key]).to eql("value") }
end
17 changes: 17 additions & 0 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,21 @@
expect(output).to include("Test info in extra_failure_lines")
end
end

describe "full error failure message and line" do
let(:fixture) { "./fixtures/rspec/no_method_error_spec.rb" }

it "outputs file name and line number" do
expect($?.exitstatus).to eql(1)

[
"undefined method `[]' for nil:NilClass",
'it("fails") { expect(nil[:key]).to eql("value") }',
"# #{fixture}:2:in `block (2 levels) in <top (required)>'",
"1 example, 1 failure",
].each do |part|
expect(output).to include(part)
end
end
end
end

0 comments on commit 6455e65

Please sign in to comment.