Skip to content

Commit

Permalink
Merge #159 'Remove the support for old style tag expressions'
Browse files Browse the repository at this point in the history
Also update Changelog.md.
  • Loading branch information
brasmusson committed Aug 5, 2018
2 parents 1ad9072 + 33257c3 commit 8147b0d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 90 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO

* N/A

### Removed

* Remove the support for old style tag expressions ([#159](https://github.com/cucumber/cucumber-ruby-core/pull/159) @brasmusson)

### Improved

* N/A
Expand Down
65 changes: 0 additions & 65 deletions lib/cucumber/core/gherkin/tag_expression.rb

This file was deleted.

11 changes: 1 addition & 10 deletions lib/cucumber/core/test/case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require 'cucumber/core/test/result'
require 'cucumber/tag_expressions'
require 'cucumber/core/gherkin/tag_expression'

module Cucumber
module Core
Expand Down Expand Up @@ -82,15 +81,7 @@ def compose_around_hooks(visitor, *args, &block)
end

def match_single_tag_expression?(expression)
if old_style_tag_expression?(expression)
Cucumber::Core::Gherkin::TagExpression.new([expression]).evaluate(tags)
else
Cucumber::TagExpressions::Parser.new.parse(expression).evaluate(tags.map(&:name))
end
end

def old_style_tag_expression?(expression)
expression.include?(',') || expression.include?('~')
Cucumber::TagExpressions::Parser.new.parse(expression).evaluate(tags.map(&:name))
end
end
end
Expand Down
15 changes: 0 additions & 15 deletions spec/cucumber/core/test/case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,6 @@ module Test
end
end

describe "matching tags (old style)" do
let(:tags) { ['@a', '@b', '@c'].map { |value| Tag.new(location, value) } }

it "matches boolean expressions of tags" do
expect( test_case.match_tags?(['@a', '@b']) ).to be_truthy
expect( test_case.match_tags?(['@a, @d']) ).to be_truthy
expect( test_case.match_tags?(['~@d']) ).to be_truthy
expect( test_case.match_tags?(['@a', '@d']) ).to be_falsy
end

it "handles mixing old and new style expressions" do
expect( test_case.match_tags?(['@a and @b', '~@d']) ).to be_truthy
end
end

describe "matching names" do
let(:name) { 'scenario' }
it "matches names against regexp" do
Expand Down

0 comments on commit 8147b0d

Please sign in to comment.