Class: Cucumber::Formatter::LegacyApi::Ast::StepInvocation

Inherits:
Struct
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/cucumber/formatter/legacy_api/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backgroundObject

Returns the value of attribute background


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def background
  @background
end

#durationObject

Returns the value of attribute duration


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def duration
  @duration
end

#embeddingsObject

Returns the value of attribute embeddings


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def embeddings
  @embeddings
end

#exceptionObject

Returns the value of attribute exception


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def exception
  @exception
end

#indentObject

Returns the value of attribute indent


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def indent
  @indent
end

#messagesObject

Returns the value of attribute messages


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def messages
  @messages
end

#statusObject

Returns the value of attribute status


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def status
  @status
end

#stepObject

Returns the value of attribute step


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def step
  @step
end

#step_matchObject

Returns the value of attribute step_match


95
96
97
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 95

def step_match
  @step_match
end

Instance Method Details

#accept(formatter) ⇒ Object


108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 108

def accept(formatter)
  formatter.before_step(self)
  Ast::Comments.new(step.comments).accept(formatter)
  messages.each { |message| formatter.puts(message) }
  embeddings.each { |embedding| embedding.send_to_formatter(formatter) }
  formatter.before_step_result(*step_result_attributes)
  print_step_name(formatter)
  Ast::MultilineArg.for(multiline_arg).accept(formatter)
  print_exception(formatter)
  formatter.after_step_result(*step_result_attributes)
  formatter.after_step(self)
end

#actual_keyword(previous_step_keyword = nil) ⇒ Object


142
143
144
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 142

def actual_keyword(previous_step_keyword = nil)
  step.actual_keyword(previous_step_keyword)
end

#backtrace_lineObject


150
151
152
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 150

def backtrace_line
  step_match.backtrace_line
end

#dom_idObject


138
139
140
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 138

def dom_id

end

#failed?Boolean


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

def failed?
  status != :passed
end

#file_colon_lineObject


146
147
148
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 146

def file_colon_line
  location.to_s
end

#passed?Boolean


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

def passed?
  status == :passed
end

#step_invocationObject


154
155
156
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 154

def step_invocation
  self
end

#step_result_attributesObject


121
122
123
124
125
126
127
128
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 121

def step_result_attributes
  legacy_multiline_arg = if multiline_arg.is_a?(Core::Ast::EmptyMultilineArgument)
                           nil
                         else
                           step.multiline_arg
                         end
  [keyword, step_match, legacy_multiline_arg, status, exception, source_indent, background, file_colon_line]
end

#to_sObject


158
159
160
# File 'lib/cucumber/formatter/legacy_api/ast.rb', line 158

def to_s
  text
end