class Cucumber::LegacyResultBuilder

Attributes

status[R]

Public Class Methods

new(result) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 937
def initialize(result)
  @result = result
  @result.describe_to(self)
end

Public Instance Methods

append_to_exception_backtrace(line) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 967
def append_to_exception_backtrace(line)
  @exception.set_backtrace(@exception.backtrace + [line.to_s]) if @exception
  return self
end
describe_exception_to(formatter) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 988
def describe_exception_to(formatter)
  formatter.exception(filtered_exception, @status) if @exception
end
duration(duration, *) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 972
def duration(duration, *)
  @duration = duration
end
exception(exception, *) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 963
def exception(exception, *)
  @exception = exception
end
failed() click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 946
def failed
  @status = :failed
end
passed() click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 942
def passed
  @status = :passed
end
pending(exception, *) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 958
def pending(exception, *)
  @exception = exception
  @status = :pending
end
scenario(name, location) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 980
def scenario(name, location)
  Ast::Scenario.new(@status, name, location)
end
scenario_outline(name, location) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 984
def scenario_outline(name, location)
  Ast::ScenarioOutline.new(@status, name, location)
end
skipped() click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 954
def skipped
  @status = :skipped
end
step_invocation(step_match, step, indent, background, configuration, messages, embeddings) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 976
def step_invocation(step_match, step, indent, background, configuration, messages, embeddings)
  Ast::StepInvocation.new(step_match, @status, @duration, step_exception(step, configuration), indent, background, step, messages, embeddings)
end
undefined() click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 950
def undefined
  @status = :undefined
end

Private Instance Methods

filtered_exception() click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 1002
def filtered_exception
  Cucumber::Formatter::BacktraceFilter.new(@exception.dup).exception
end
filtered_step_exception(step) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 1006
def filtered_step_exception(step)
  exception = filtered_exception
  return Cucumber::Formatter::BacktraceFilter.new(exception).exception
end
step_exception(step, configuration) click to toggle source
# File lib/cucumber/formatter/legacy_api/adapter.rb, line 994
def step_exception(step, configuration)
  return filtered_step_exception(step) if @exception
  return nil unless @status == :undefined && configuration.strict?
  @exception = Cucumber::Undefined.from(@result, step.name)
  @exception.backtrace << step.backtrace_line
  filtered_step_exception(step)
end