Class: RSpec::Distrib::ExecutionResults::Exception Private
- Inherits:
-
Object
- Object
- RSpec::Distrib::ExecutionResults::Exception
- 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 Exception on the Reporters.
This is necessary because some exceptions are quite large and not Marshalable.
Instance Attribute Summary collapse
- #backtrace ⇒ Object readonly private
- #cause ⇒ Object readonly private
- #message ⇒ Object readonly private
- #original_class ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(exception) ⇒ Exception
constructor
private
rubocop:disable Metrics/MethodLength.
-
#set_backtrace(backtrace) ⇒ Object
private
rubocop:disable Naming/AccessorMethodName as on original interface.
Constructor Details
#initialize(exception) ⇒ Exception
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.
rubocop:disable Metrics/MethodLength
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/rspec/distrib/example_group.rb', line 161 def initialize(exception) # rubocop:disable Metrics/MethodLength @original_class = if exception.is_a?(Class) exception.to_s else exception.class.to_s end if multiple_exceptions?(exception) initialize_as_multiple_exceptions(exception) return end @backtrace = exception.backtrace @cause = Exception.new(exception.cause) if exception.cause @message = exception. end |
Instance Attribute Details
#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.
159 160 161 |
# File 'lib/rspec/distrib/example_group.rb', line 159 def backtrace @backtrace end |
#cause ⇒ 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.
159 160 161 |
# File 'lib/rspec/distrib/example_group.rb', line 159 def cause @cause end |
#message ⇒ 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.
159 160 161 |
# File 'lib/rspec/distrib/example_group.rb', line 159 def @message end |
#original_class ⇒ 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.
159 160 161 |
# File 'lib/rspec/distrib/example_group.rb', line 159 def original_class @original_class end |
Instance Method Details
#set_backtrace(backtrace) ⇒ 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.
rubocop:disable Naming/AccessorMethodName as on original interface
178 179 180 |
# File 'lib/rspec/distrib/example_group.rb', line 178 def set_backtrace(backtrace) # rubocop:disable Naming/AccessorMethodName as on original interface @backtrace = backtrace end |