Given the following failing example in failing_example.rb
require 'wrong/adapters/rspec'
describe "a block arg in a failing assertion" do
it "raises a NameError :(" do
assert { [].each {|v|} != [] }
end
end
When I run rspec failing_example.rb
Then I get this error:
F
Failures:
1) a block arg in a failing assertion raises a NameError :(
Failure/Error: assert { [].each {|v|} != [] }
Expected [].each { |v| }.!=([]), but
(v) raises NameError: undefined local variable or method `v' for #<RSpec::Core::ExampleGroup::Nested_1:0x007f938a0d1ef0>
# ./failing_example.rb:5:in `block (2 levels) in <top (required)>'
The example should fail, that's not the problem. The problem is the failure message should indicate that the values were not equal, not a NameError on v
That's funny. My guess is that the parser doesn't distinguish between "v" in a block parameter list and "v" as a standalone statement. Should be fixable; thanks for pointing it out.
Given the following failing example in failing_example.rb
When I run
rspec failing_example.rb
Then I get this error:
The example should fail, that's not the problem. The problem is the failure message should indicate that the values were not equal, not a
NameError
onv