[rspec-users] Different behavior for ":<line>" vs "--line_number <line" wrt filters?

Kylo Ginsberg kylo at kylo.net
Fri Nov 1 18:07:24 UTC 2013


I just discovered that running a specific test or set of tests via
":<line>" doesn't honor filters but "--line_number <line>" does.  E.g.

> cat fun_with_line_numbers.rb
describe ":if => false", :if => false do
  it "should not run" do
    false
  end
end

> rspec -fd fun_with_line_numbers.rb:1
Run options: include {:locations=>{"./fun_with_line_numbers.rb"=>[1]}}

:if => false
  should not run

Finished in 0.00047 seconds
1 example, 0 failures

> rspec -fd fun_with_line_numbers.rb --line_number 1
Run options: include {:line_numbers=>[1]}

All examples were filtered out

Finished in 0.00004 seconds
0 examples, 0 failures

Is this difference a bug or a feature?  If the latter, is it documented
behavior?

Thanks!
Kylo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20131101/702ddead/attachment-0001.html>


More information about the rspec-users mailing list