lib/cucumber/ast/outline_table.rb in casecumber-1.0.2.1 vs lib/cucumber/ast/outline_table.rb in casecumber-1.2.1.cb2
- old
+ new
@@ -31,13 +31,17 @@
end
def accept_hook?(hook)
@scenario_outline.accept_hook?(hook)
end
-
+
+ def source_tags
+ @scenario_outline.source_tags
+ end
+
def source_tag_names
- @scenario_outline.source_tag_names
+ source_tags.map { |tag| tag.name }
end
def skip_invoke!
init
example_rows.each do |cells|
@@ -50,11 +54,11 @@
@dunit = true
example_rows.each do |cells|
cells.create_step_invocations!(scenario_outline)
end
end
-
+
def example_rows
cells_rows[1..-1]
end
def visit_scenario_name(visitor, row)
@@ -63,33 +67,37 @@
def language
@scenario_outline.language
end
- class ExampleRow < Cells #:nodoc:
+ class ExampleRow < Cells #:nodoc:
class InvalidForHeaderRowError < NoMethodError
def initialize(*args)
super 'This is a header row and cannot pass or fail'
end
end
-
+
attr_reader :scenario_outline # https://rspec.lighthouseapp.com/projects/16211/tickets/342
def initialize(table, cells)
super
@scenario_exception = nil
end
-
+
def source_tag_names
- @table.source_tag_names
+ source_tags.map { |tag| tag.name }
end
+ def source_tags
+ @table.source_tags
+ end
+
def create_step_invocations!(scenario_outline)
@scenario_outline = scenario_outline
@step_invocations = scenario_outline.step_invocations(self)
end
-
+
def skip_invoke!
@step_invocations.each do |step_invocation|
step_invocation.skip_invoke!
end
end
@@ -113,11 +121,11 @@
end
@cells.each do |cell|
visitor.visit_table_cell(cell)
end
-
+
visitor.visit_exception(@scenario_exception, :failed) if @scenario_exception
end
end
end
@@ -136,18 +144,18 @@
end
def accept_hook?(hook)
@table.accept_hook?(hook)
end
-
+
def exception
@exception || @scenario_exception
end
-
+
def fail!(exception)
@scenario_exception = exception
end
-
+
# Returns true if one or more steps failed
def failed?
raise InvalidForHeaderRowError if header?
@step_invocations.failed? || !!@scenario_exception
end