Class: Buildkite::TestCollector::CucumberPlugin::Trace

Inherits:
Trace
  • Object
show all
Defined in:
lib/buildkite/test_collector/cucumber_plugin/trace.rb

Constant Summary collapse

FILE_PATH_REGEX =
/^(.*?\.(rb|feature))/

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Trace

#as_hash

Constructor Details

#initialize(scenario, history:, failure_reason: nil, failure_expanded: [], tags: nil, location_prefix: nil) ⇒ Trace

Returns a new instance of Trace.



10
11
12
13
14
15
16
17
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 10

def initialize(scenario, history:, failure_reason: nil, failure_expanded: [], tags: nil, location_prefix: nil)
  @scenario         = scenario
  @history          = history
  @failure_reason   = failure_reason
  @failure_expanded = failure_expanded
  @tags             = tags
  @location_prefix  = location_prefix
end

Instance Attribute Details

#failure_expandedObject

Returns the value of attribute failure_expanded.



5
6
7
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 5

def failure_expanded
  @failure_expanded
end

#failure_reasonObject

Returns the value of attribute failure_reason.



5
6
7
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 5

def failure_reason
  @failure_reason
end

#historyObject (readonly)

Returns the value of attribute history.



6
7
8
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 6

def history
  @history
end

#location_prefixObject (readonly)

Returns the value of attribute location_prefix.



6
7
8
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 6

def location_prefix
  @location_prefix
end

#scenarioObject

Returns the value of attribute scenario.



5
6
7
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 5

def scenario
  @scenario
end

#tagsObject (readonly)

Returns the value of attribute tags.



6
7
8
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 6

def tags
  @tags
end

Instance Method Details

#resultObject



19
20
21
22
23
24
25
26
27
# File 'lib/buildkite/test_collector/cucumber_plugin/trace.rb', line 19

def result
  if scenario.passed?
    'passed'
  elsif scenario.failed?
    'failed'
  else
    'skipped'
  end
end