Skip to content

Commit

Permalink
Restore support for matching a scenario by its tags' line numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
botandrose-machine committed Aug 16, 2022
1 parent b3e4f46 commit 0290bb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO

### Fixed

* Restore support for matching a scenario by its tags' and steps' line numbers.

### Dependencies

## [11.0.0](https://github.com/cucumber/cucumber-ruby-core/compare/v10.1.1...v11.0.0)
Expand Down Expand Up @@ -362,4 +364,4 @@ Changes were not logged.
Changes were not logged.


[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/v10.1.1...main
[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/v10.1.1...main
6 changes: 5 additions & 1 deletion lib/cucumber/core/test/case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def match_locations?(queried_locations)
end

def matching_locations
[location] + test_steps.map(&:location)
[
location,
tags.map(&:location),
test_steps.map(&:location),
].flatten
end

def inspect
Expand Down
4 changes: 2 additions & 2 deletions spec/cucumber/core/test/filters/locations_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_case_named(name)
expect(receiver.test_case_locations).to eq [test_case_named('two').location]
end

xit "matches a location on the scenario's tags" do
it "matches a location on the scenario's tags" do
location = Test::Location.new(file, 7)
filter = Test::LocationsFilter.new([location])
compile [doc], receiver, [filter]
Expand Down Expand Up @@ -284,7 +284,7 @@ def test_case_named(name)
expect(receiver.test_case_locations.map(&:line)).to eq [19, 23, 24]
end

xit "matches a location on the scenario outline's tags with all test cases of all the tables" do
it "matches a location on the scenario outline's tags with all test cases of all the tables" do
location = Test::Location.new(file, 7)
filter = Test::LocationsFilter.new([location])
compile [doc], receiver, [filter]
Expand Down

0 comments on commit 0290bb0

Please sign in to comment.