Skip to content

Commit

Permalink
Remove the support for old style tag expressions
Browse files Browse the repository at this point in the history
Remove the support for "~" and "," in tag expressions.
  • Loading branch information
brasmusson committed Aug 2, 2018
1 parent 1ad9072 commit 33257c3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 90 deletions.
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 33257c3

Please sign in to comment.