Class: Buildkite::TestCollector::RSpecPlugin::Trace
- Inherits:
-
Object
- Object
- Buildkite::TestCollector::RSpecPlugin::Trace
- Defined in:
- lib/buildkite/test_collector/rspec_plugin/trace.rb
Constant Summary collapse
- FILE_PATH_REGEX =
/^(.*?\.(rb|feature))/
Instance Attribute Summary collapse
-
#example ⇒ Object
Returns the value of attribute example.
-
#failure_expanded ⇒ Object
Returns the value of attribute failure_expanded.
-
#failure_reason ⇒ Object
Returns the value of attribute failure_reason.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(example, history:, failure_reason: nil, failure_expanded: []) ⇒ Trace
constructor
A new instance of Trace.
- #result ⇒ Object
Constructor Details
#initialize(example, history:, failure_reason: nil, failure_expanded: []) ⇒ Trace
Returns a new instance of Trace.
10 11 12 13 14 15 |
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 10 def initialize(example, history:, failure_reason: nil, failure_expanded: []) @example = example @history = history @failure_reason = failure_reason @failure_expanded = end |
Instance Attribute Details
#example ⇒ Object
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_expanded ⇒ Object
Returns the value of attribute failure_expanded.
5 6 7 |
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 5 def @failure_expanded end |
#failure_reason ⇒ Object
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 |
#history ⇒ Object (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 |
Instance Method Details
#as_hash ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 25 def as_hash strip_invalid_utf8_chars( scope: example.example_group.[:full_description], name: example.description, location: example.location, file_name: file_name, result: result, failure_reason: failure_reason, failure_expanded: , history: history, ).select { |_, value| !value.nil? } end |
#result ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/buildkite/test_collector/rspec_plugin/trace.rb', line 17 def result case example.execution_result.status when :passed; "passed" when :failed; "failed" when :pending; "skipped" end end |