Skip to content

Commit

Permalink
Upgraded to gherkin 2.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Feb 18, 2012
1 parent b7d7e97 commit 4bc5ed6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 30 deletions.
3 changes: 2 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## In Git
## [v1.1.5](https://github.com/cucumber/cucumber/compare/v1.1.4...v1.1.5)

### New Features

* Added `file_colon_line` to `stepdefs.json` (outputted by `--dotcucumber`). ([#214](https://github.com/cucumber/cucumber/pull/214) MOROHASHI Kyosuke)
* Upgraded to gherkin 2.3.8 (Aslak Hellesøy)

### Bugfixes

Expand Down
4 changes: 2 additions & 2 deletions cucumber.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ for important information about this release. Happy cuking!
}

s.add_runtime_dependency 'gherkin', '~> 2.7.3'
s.add_runtime_dependency 'gherkin', '~> 2.8.0'
s.add_runtime_dependency 'term-ansicolor', '>= 1.0.6'
s.add_runtime_dependency 'builder', '>= 2.1.2'
s.add_runtime_dependency 'diff-lcs', '>= 1.1.2'
s.add_runtime_dependency 'json', '>= 1.4.6'

s.add_development_dependency 'aruba', '~> 0.4.11'
s.add_development_dependency 'rake', '>= 0.9.2'
s.add_development_dependency 'rspec', '>= 2.8.0'
s.add_development_dependency 'rspec', '~> 2.7.0' # We'll bump when gherkin is ready to bump
s.add_development_dependency 'nokogiri', '>= 1.5.0'
s.add_development_dependency 'prawn', '~> 0.8.4'
s.add_development_dependency 'prawn-layout', '~> 0.8.4'
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/ast/background.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def fail!(exception)
# Override this method, as there are situations where the background
# wind up being the one called fore Before scenarios, and
# backgrounds don't have tags.
def source_tag_names
def source_tags
[]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/cucumber/ast/feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def indented_name
end.join("\n")
end

def source_tag_names
@tags.tag_names
def source_tags
@tags.tags
end

def accept_hook?(hook)
Expand Down
6 changes: 3 additions & 3 deletions lib/cucumber/ast/feature_element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def max_line_length
end

def accept_hook?(hook)
Gherkin::TagExpression.new(hook.tag_expressions).eval(source_tag_names)
Gherkin::TagExpression.new(hook.tag_expressions).eval(source_tags)
end

def source_tag_names
(@tags.tag_names.to_a + (@feature ? @feature.source_tag_names.to_a : [])).uniq
def source_tags
(@tags.tags.to_a + (@feature ? @feature.source_tags.to_a : [])).uniq
end

def language
Expand Down
8 changes: 4 additions & 4 deletions lib/cucumber/ast/outline_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def accept_hook?(hook)
@scenario_outline.accept_hook?(hook)
end

def source_tag_names
@scenario_outline.source_tag_names
def source_tags
@scenario_outline.source_tags
end

def skip_invoke!
Expand Down Expand Up @@ -79,8 +79,8 @@ def initialize(table, cells)
@scenario_exception = nil
end

def source_tag_names
@table.source_tag_names
def source_tags
@table.source_tags
end

def create_step_invocations!(scenario_outline)
Expand Down
14 changes: 7 additions & 7 deletions lib/cucumber/ast/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
module Cucumber
module Ast
class Tags #:nodoc:
attr_reader :tag_names
attr_reader :tags

def initialize(line, tag_names)
@line, @tag_names = line, tag_names
def initialize(line, tags)
@line, @tags = line, tags
end

def accept(visitor)
return if Cucumber.wants_to_quit
@tag_names.each do |tag_name|
visitor.visit_tag_name(tag_name)
@tags.each do |tag|
visitor.visit_tag_name(tag.name)
end
end

def accept_hook?(hook)
Gherkin::TagExpression.new(hook.tag_expressions).eval(@tag_names)
Gherkin::TagExpression.new(hook.tag_expressions).eval(@tags)
end

def to_sexp
@tag_names.map{|tag_name| [:tag, tag_name]}
@tags.map{|tag| [:tag, tag.name]}
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/cucumber/parser/gherkin_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def feature(feature)
@feature = Ast::Feature.new(
nil,
Ast::Comment.new(feature.comments.map{|comment| comment.value}.join("\n")),
Ast::Tags.new(nil, feature.tags.map{|tag| tag.name}),
Ast::Tags.new(nil, feature.tags),
feature.keyword,
feature.name.lstrip,
feature.description.rstrip,
Expand Down Expand Up @@ -47,7 +47,7 @@ def scenario(statement)
scenario = Ast::Scenario.new(
@background,
Ast::Comment.new(statement.comments.map{|comment| comment.value}.join("\n")),
Ast::Tags.new(nil, statement.tags.map{|tag| tag.name}),
Ast::Tags.new(nil, statement.tags),
statement.line,
statement.keyword,
statement.name,
Expand All @@ -64,7 +64,7 @@ def scenario_outline(statement)
scenario_outline = Ast::ScenarioOutline.new(
@background,
Ast::Comment.new(statement.comments.map{|comment| comment.value}.join("\n")),
Ast::Tags.new(nil, statement.tags.map{|tag| tag.name}),
Ast::Tags.new(nil, statement.tags),
statement.line,
statement.keyword,
statement.name,
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Cucumber
unless defined?(Cucumber::VERSION)
VERSION = '1.1.4'
VERSION = '1.1.5'
BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
JRUBY = defined?(JRUBY_VERSION)
Expand Down
8 changes: 4 additions & 4 deletions lib/cucumber/wire_support/wire_protocol/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ class DiffOk < RequestHandler
end

module Tags
def clean_tags(scenario)
scenario.source_tag_names.map { |tag| tag.gsub(/^@/, '') }.sort
def clean_tag_names(scenario)
scenario.source_tags.map { |tag| tag.name.gsub(/^@/, '') }.sort
end

def request_params(scenario)
return nil unless scenario.source_tag_names.any?
{ "tags" => clean_tags(scenario) }
return nil unless scenario.source_tags.any?
{ "tags" => clean_tag_names(scenario) }
end
end

Expand Down
5 changes: 3 additions & 2 deletions spec/cucumber/ast/feature_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'cucumber/ast'
require 'cucumber/step_mother'
require 'gherkin/formatter/model'

module Cucumber
module Ast
Expand Down Expand Up @@ -35,14 +36,14 @@ def create_feature(dsl)
f = Ast::Feature.new(
background,
Ast::Comment.new("# My feature comment\n"),
Ast::Tags.new(6, ['one', 'two']),
Ast::Tags.new(6, [Gherkin::Formatter::Model::Tag.new('one', 6), Gherkin::Formatter::Model::Tag.new('two', 6)]),
"Feature",
"Pretty printing",
"",
[Ast::Scenario.new(
background,
Ast::Comment.new(" # My scenario comment \n# On two lines \n"),
Ast::Tags.new(8, ['three', 'four']),
Ast::Tags.new(8, [Gherkin::Formatter::Model::Tag.new('three', 8), Gherkin::Formatter::Model::Tag.new('four', 8)]),
9,
"Scenario:", "A Scenario", "",
[
Expand Down

0 comments on commit 4bc5ed6

Please sign in to comment.