Class: Cucumber::Formatter::LegacyApi::Adapter::LegacyResultBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/formatter/legacy_api/adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ LegacyResultBuilder

Returns a new instance of LegacyResultBuilder.



937
938
939
940
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 937

def initialize(result)
  @result = result
  @result.describe_to(self)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



936
937
938
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 936

def status
  @status
end

Instance Method Details

#append_to_exception_backtrace(line) ⇒ Object



967
968
969
970
# 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) ⇒ Object



988
989
990
# 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) ⇒ Object



972
973
974
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 972

def duration(duration, *)
  @duration = duration
end

#exception(exception) ⇒ Object



963
964
965
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 963

def exception(exception, *)
  @exception = exception
end

#failedObject



946
947
948
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 946

def failed
  @status = :failed
end

#passedObject



942
943
944
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 942

def passed
  @status = :passed
end

#pending(exception) ⇒ Object



958
959
960
961
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 958

def pending(exception, *)
  @exception = exception
  @status = :pending
end

#scenario(name, location) ⇒ Object



980
981
982
# 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) ⇒ Object



984
985
986
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 984

def scenario_outline(name, location)
  Ast::ScenarioOutline.new(@status, name, location)
end

#skippedObject



954
955
956
# 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) ⇒ Object



976
977
978
# 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

#undefinedObject



950
951
952
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 950

def undefined
  @status = :undefined
end