Class: Cucumber::Ast::OutlineTable::ExampleRow

Inherits:
Cells
  • Object
show all
Defined in:
lib/cucumber/ast/outline_table.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scenario_outlineObject (readonly)



48
49
50
# File 'lib/cucumber/ast/outline_table.rb', line 48

def scenario_outline
  @scenario_outline
end

Instance Method Details

#accept(visitor) ⇒ Object



61
62
63
64
# File 'lib/cucumber/ast/outline_table.rb', line 61

def accept(visitor)
  return if $cucumber_interrupted
  visitor.options[:expand] ? accept_expand(visitor) : accept_plain(visitor)
end

#accept_expand(visitor) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/cucumber/ast/outline_table.rb', line 88

def accept_expand(visitor)
  if header?
  else
    visitor.step_mother.before_and_after(self) do
      @table.visit_scenario_name(visitor, self)
      @step_invocations.each do |step_invocation|
        step_invocation.invoke(visitor.step_mother, visitor.options)
        @exception ||= step_invocation.reported_exception
        step_invocation.visit_step_result(visitor)
      end
    end
  end
end

#accept_hook?(hook) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/cucumber/ast/outline_table.rb', line 102

def accept_hook?(hook)
  @table.accept_hook?(hook)
end

#accept_plain(visitor) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cucumber/ast/outline_table.rb', line 66

def accept_plain(visitor)
  if header?
    @cells.each do |cell|
      cell.status = :skipped_param
      visitor.visit_table_cell(cell)
    end
  else
    visitor.step_mother.before_and_after(self) do
      @step_invocations.each do |step_invocation|
        step_invocation.invoke(visitor.step_mother, visitor.options)
        @exception ||= step_invocation.reported_exception
      end

      @cells.each do |cell|
        visitor.visit_table_cell(cell)
      end
      
      visitor.visit_exception(@scenario_exception, :failed) if @scenario_exception
    end
  end
end

#backtrace_lineObject



130
131
132
# File 'lib/cucumber/ast/outline_table.rb', line 130

def backtrace_line
  @scenario_outline.backtrace_line(name, line)
end

#create_step_invocations!(scenario_outline) ⇒ Object



50
51
52
53
# File 'lib/cucumber/ast/outline_table.rb', line 50

def create_step_invocations!(scenario_outline)
  @scenario_outline = scenario_outline
  @step_invocations = scenario_outline.step_invocations(self)
end

#exceptionObject



106
107
108
# File 'lib/cucumber/ast/outline_table.rb', line 106

def exception
  @exception || @scenario_exception
end

#fail!(exception) ⇒ Object



110
111
112
# File 'lib/cucumber/ast/outline_table.rb', line 110

def fail!(exception)
  @scenario_exception = exception
end

#failed?Boolean

Returns true if one or more steps failed

Returns:

  • (Boolean)


115
116
117
# File 'lib/cucumber/ast/outline_table.rb', line 115

def failed?
  @step_invocations.failed? || !!@scenario_exception
end

#nameObject



134
135
136
# File 'lib/cucumber/ast/outline_table.rb', line 134

def name
  "| #{@cells.collect{|c| c.value }.join(' | ')} |"
end

#passed?Boolean

Returns true if all steps passed

Returns:

  • (Boolean)


120
121
122
# File 'lib/cucumber/ast/outline_table.rb', line 120

def passed?
  !failed?
end

#skip_invoke!Object



55
56
57
58
59
# File 'lib/cucumber/ast/outline_table.rb', line 55

def skip_invoke!
  @step_invocations.each do |step_invocation|
    step_invocation.skip_invoke!
  end
end

#statusObject

Returns the status



125
126
127
128
# File 'lib/cucumber/ast/outline_table.rb', line 125

def status
  return :failed if @scenario_exception
  @step_invocations.status
end