Class: RSpec::Distrib::ExecutionResults::Exception Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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.message
end

Instance Attribute Details

#backtraceObject (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

#causeObject (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

#messageObject (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
  @message
end

#original_classObject (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