Class: Buildkite::TestCollector::RSpecPlugin::Trace

Inherits:
Trace
  • Object
show all
Defined in:
lib/buildkite/test_collector/rspec_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(example, history:, failure_reason: nil, failure_expanded: [], tags: nil, location_prefix: nil) ⇒ Trace

Returns a new instance of Trace.



12
13
14
15
16
17
18
19
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 12

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

Instance Attribute Details

#exampleObject

Returns the value of attribute example.



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

def example
  @example
end

#failure_expandedObject

Returns the value of attribute failure_expanded.



5
6
7
# File 'lib/buildkite/test_collector/rspec_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/rspec_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/rspec_plugin/trace.rb', line 6

def history
  @history
end

#location_prefixObject (readonly)

Returns the value of attribute location_prefix.



8
9
10
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 8

def location_prefix
  @location_prefix
end

#tagsObject (readonly)

Returns the value of attribute tags.



7
8
9
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 7

def tags
  @tags
end

Instance Method Details

#resultObject



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

def result
  case example.execution_result.status
  when :passed; "passed"
  when :failed; "failed"
  when :pending; "skipped"
  end
end