Skip to content

Instantly share code, notes, and snippets.

@czak
Created March 14, 2011 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czak/870018 to your computer and use it in GitHub Desktop.
Save czak/870018 to your computer and use it in GitHub Desktop.
Failing scenario when an outer-level example is placed after a nested example group
Feature: line number appended to file path
To run a single example or group, you can append the line number to the path, e.g.
rspec path/to/example_spec.rb:37
Background:
Given a file named "example_spec.rb" with:
"""
describe "outer group" do
it "first example in outer group" do
end
it "second example in outer group" do
end
describe "nested group" do
it "example in nested group" do
end
end
it "third example in outer group" do
end
end
"""
# ... hidden original scenarios for brevity ...
Scenario: three examples - third example on declaration line
When I run "rspec example_spec.rb:19 --format doc"
Then the examples should all pass
And the output should contain "third example in outer group"
But the output should not contain "first example in outer group"
But the output should not contain "second example in outer group"
And the output should not contain "example in nested group"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment