Class: RSpec::Distrib::ExampleResult Private
- Inherits:
-
Object
- Object
- RSpec::Distrib::ExampleResult
- Extended by:
- DelegateToMetadata
- Defined in:
- lib/rspec/distrib/example_group.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Objects that mimic an RSpec::Core::Example on the Reporters.
This is necessary because the RSpec::Core::Example is quite large and not Marshalable.
So we send this object to the Leader instead of the real Example.
Instance Attribute Summary collapse
- #description ⇒ Object readonly private
- #example ⇒ Object readonly private
- #example_group ⇒ Object readonly private
- #formatted_backtrace ⇒ Object readonly private
- #location_rerun_argument ⇒ Object readonly private
- #metadata ⇒ Object readonly private
Instance Method Summary collapse
- #exception ⇒ Object private
- #fully_formatted_lines(_failure_number = nil, _colorizer = nil) ⇒ Object private
- #id ⇒ Object private
-
#initialize(example, example_group) ⇒ ExampleResult
constructor
private
A new instance of ExampleResult.
Methods included from DelegateToMetadata
Constructor Details
#initialize(example, example_group) ⇒ ExampleResult
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ExampleResult.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/rspec/distrib/example_group.rb', line 93 def initialize(example, example_group) (example.) @description = example.description @location_rerun_argument = example.location_rerun_argument @example_group = example_group exception_presenter = RSpec::Core::Formatters::ExceptionPresenter::Factory.new(example).build if example.exception # rubocop:disable Style/GuardClause colorizer = ::RSpec::Core::Notifications::NullColorizer # FIXME: figure out how to pass proper failure_number @fully_formatted_lines = exception_presenter.fully_formatted_lines(1, colorizer) @formatted_backtrace = exception_presenter.formatted_backtrace end end |
Instance Attribute Details
#description ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def description @description end |
#example ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def example @example end |
#example_group ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def example_group @example_group end |
#formatted_backtrace ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def formatted_backtrace @formatted_backtrace end |
#location_rerun_argument ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def location_rerun_argument @location_rerun_argument end |
#metadata ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 |
# File 'lib/rspec/distrib/example_group.rb', line 87 def end |
Instance Method Details
#exception ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
108 109 110 |
# File 'lib/rspec/distrib/example_group.rb', line 108 def exception execution_result.exception end |
#fully_formatted_lines(_failure_number = nil, _colorizer = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
116 117 118 |
# File 'lib/rspec/distrib/example_group.rb', line 116 def fully_formatted_lines(_failure_number = nil, _colorizer = nil) @fully_formatted_lines end |
#id ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
112 113 114 |
# File 'lib/rspec/distrib/example_group.rb', line 112 def id "#{metadata[:rerun_file_path]}[#{metadata[:scoped_id]}]" end |