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

Returns:

  • (Object)

    the current value of background



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

def background
  @background
end

#durationObject

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



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

def duration
  @duration
end

#embeddingsObject

Returns the value of attribute embeddings

Returns:

  • (Object)

    the current value of embeddings



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

def embeddings
  @embeddings
end

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



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

def exception
  @exception
end

#indentObject

Returns the value of attribute indent

Returns:

  • (Object)

    the current value of indent



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

def indent
  @indent
end

#messagesObject

Returns the value of attribute messages

Returns:

  • (Object)

    the current value of messages



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

def messages
  @messages
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



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

def step
  @step
end

#step_matchObject

Returns the value of attribute step_match

Returns:

  • (Object)

    the current value of step_match



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

def step_match
  @step_match
end

Instance Method Details

#accept(formatter) ⇒ Object



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

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



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

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

#backtrace_lineObject



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

def backtrace_line
  step_match.backtrace_line
end

#dom_idObject



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

def dom_id

end

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?
  status != :passed
end

#file_colon_lineObject



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

def file_colon_line
  location.to_s
end

#passed?Boolean

Returns:

  • (Boolean)


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

def passed?
  status == :passed
end

#step_invocationObject



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

def step_invocation
  self
end

#step_result_attributesObject



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

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