lib/cucumber/ast/scenario_outline.rb in cucumber-0.10.6 vs lib/cucumber/ast/scenario_outline.rb in cucumber-0.10.7
- old
+ new
@@ -1,12 +1,14 @@
+require 'cucumber/ast/feature_element'
+require 'cucumber/ast/names'
+
module Cucumber
module Ast
class ScenarioOutline #:nodoc:
include FeatureElement
+ include Names
- attr_reader :name
-
module ExamplesArray #:nodoc:
def accept(visitor)
return if Cucumber.wants_to_quit
each do |examples|
visitor.visit_examples(examples)
@@ -18,12 +20,12 @@
# an Examples section. This array has 3 elements:
#
# * Examples keyword
# * Examples section name
# * Raw matrix
- def initialize(background, comment, tags, line, keyword, name, raw_steps, example_sections)
- @background, @comment, @tags, @line, @keyword, @name, @raw_steps, @example_sections = background, comment, tags, line, keyword, name, raw_steps, example_sections
+ def initialize(background, comment, tags, line, keyword, title, description, raw_steps, example_sections)
+ @background, @comment, @tags, @line, @keyword, @title, @description, @raw_steps, @example_sections = background, comment, tags, line, keyword, title, description, raw_steps, example_sections
end
def add_examples(example_section, gherkin_examples)
@example_sections << [example_section, gherkin_examples]
end
@@ -35,18 +37,19 @@
@examples_array = @example_sections.map do |example_section_and_gherkin_examples|
example_section = example_section_and_gherkin_examples[0]
gherkin_examples = example_section_and_gherkin_examples[1]
- examples_comment = example_section[0]
- examples_line = example_section[1]
- examples_keyword = example_section[2]
- examples_name = example_section[3]
- examples_matrix = example_section[4]
+ examples_comment = example_section[0]
+ examples_line = example_section[1]
+ examples_keyword = example_section[2]
+ examples_title = example_section[3]
+ examples_description = example_section[4]
+ examples_matrix = example_section[5]
examples_table = OutlineTable.new(examples_matrix, self)
- ex = Examples.new(examples_comment, examples_line, examples_keyword, examples_name, examples_table)
+ ex = Examples.new(examples_comment, examples_line, examples_keyword, examples_title, examples_description, examples_table)
ex.gherkin_statement(gherkin_examples)
ex
end
@examples_array.extend(ExamplesArray)
@@ -56,11 +59,11 @@
def accept(visitor)
return if Cucumber.wants_to_quit
visitor.visit_comment(@comment) unless @comment.empty?
visitor.visit_tags(@tags)
- visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
+ visitor.visit_scenario_name(@keyword, name, file_colon_line(@line), source_indent(first_line_length))
visitor.visit_steps(@steps)
skip_invoke! if @background && @background.failed?
visitor.visit_examples_array(@examples_array) unless @examples_array.empty?
end
@@ -105,10 +108,10 @@
@examples_array.select{|examples| examples.failed?}.any?
end
def to_sexp
init
- sexp = [:scenario_outline, @keyword, @name]
+ sexp = [:scenario_outline, @keyword, name]
comment = @comment.to_sexp
sexp += [comment] if comment
tags = @tags.to_sexp
sexp += tags if tags.any?
steps = @steps.to_sexp