Skip to content

Mixing nested groups and outer-level examples gives unpredictable :line_number behavior #337

Closed
czak opened this Issue Mar 14, 2011 · 1 comment

3 participants

@czak
czak commented Mar 14, 2011

The simplest example:

describe "outer group" do
  describe "nested group" do
    it "example in nested group" do
    end
  end
  it "example in outer group" do
  end
end

I expect to run only the single outer-level example with:

rspec example_spec.rb:6

However, this somehow matches the innermost example:

$ rspec -fd example_spec.rb:6
Run filtered using {:line_number=>6}

outer group
  nested group
    example in nested group

Finished in 0.00044 seconds
1 example, 0 failures

If I put the outer example before the nested group, it can be matched properly with the line number.

Here is a gist extracted from features/command_line/line_number_appended_to_path.feature with a failing scenario describing this issue: https://gist.github.com/870018

Wish I could help more.

@arturmalecki

Fix bug where mixing nested groups and outer-level examples gave
unpredictable :line_number behavior

@dchelimsky dchelimsky closed this Mar 24, 2011
@andreastt andreastt pushed a commit that referenced this issue Apr 29, 2011
Artur Małecki Fix bug where mixing nested groups and outer-level examples gave
unpredictable :line_number behavior

- Closes #337.
- Closes #340.
a368a1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.