Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the support for old style tag expressions #159

Merged
merged 1 commit into from
Aug 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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