Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
Use latest gherkin (faster install)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeiser committed Apr 7, 2016
1 parent 43d1f79 commit 701cd60
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Gemfile.lock
.rvmrc
/.bundle/
/tags
binstubs/
2 changes: 1 addition & 1 deletion foodcritic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.license = 'MIT'
s.executables << 'foodcritic'
s.required_ruby_version = ">= 2.0.0"
s.add_dependency('gherkin', '~> 2.11')
s.add_dependency('cucumber-core', '>= 1.3')
s.add_dependency('nokogiri', '>= 1.5', '< 2.0')
s.add_dependency('rake')
s.add_dependency('treetop', '~> 1.4')
Expand Down
2 changes: 1 addition & 1 deletion lib/foodcritic.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'pathname'
require 'gherkin'
require 'cucumber/core'
require 'treetop'
require 'ripper'
require 'yajl'
Expand Down
8 changes: 4 additions & 4 deletions lib/foodcritic/domain.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'gherkin/tag_expression'
require 'cucumber/core/gherkin/tag_expression'

module FoodCritic
# A warning of a possible issue
Expand Down Expand Up @@ -95,9 +95,9 @@ def tags

# Checks the rule tags to see if they match a Gherkin (Cucumber) expression
def matches_tags?(tag_expr)
Gherkin::TagExpression.new(tag_expr).evaluate(tags.map do |t|
Gherkin::Formatter::Model::Tag.new(t, 1)
end)
Cucumber::Core::Gherkin::TagExpression.new(tag_expr).evaluate(
tags.map { |tag| Cucumber::Core::Ast::Tag.new(nil, tag) }
)
end

# Returns a string representation of this rule.
Expand Down
6 changes: 3 additions & 3 deletions spec/foodcritic/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def parse_ast(str)
end

describe "#checks_for_chef_solo?" do
let(:ast) { ast = MiniTest::Mock.new }
let(:ast) { MiniTest::Mock.new }
it "raises if the provided ast does not support XPath" do
lambda{api.checks_for_chef_solo?(nil)}.must_raise(ArgumentError)
end
Expand Down Expand Up @@ -459,7 +459,7 @@ def parse_ast(str)
end

describe "#literal_searches" do
let(:ast) { ast = MiniTest::Mock.new }
let(:ast) { MiniTest::Mock.new }
it "returns empty if the AST does not support XPath expressions" do
api.literal_searches(nil).must_be_empty
end
Expand Down Expand Up @@ -1642,7 +1642,7 @@ def str_to_atts(str)
end

describe "#searches" do
let(:ast) { ast = MiniTest::Mock.new }
let(:ast) { MiniTest::Mock.new }
it "returns empty if the AST does not support XPath expressions" do
api.searches('not-an-ast').must_be_empty
end
Expand Down

0 comments on commit 701cd60

Please sign in to comment.