123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::SuiteHookContext Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Example
Instance Chain:
self, Example
Inherits: RSpec::Core::Example
Defined in: rspec-core/lib/rspec/core/example.rb

Overview

Provides an execution context for before/after :suite hooks.

Constant Summary

Example - Inherited

AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt

Class Method Summary

Example - Inherited

.delegate_to_metadata

Used to define methods that delegate to this example’s metadata.

.new

Creates a new instance of Example.

.parse_id

Instance Attribute Summary

Example - Inherited

#clock,
#display_exception

The exception that will be displayed to the user – either the failure of the example or the ‘pending_exception` if the example is pending.

#display_exception=

Assigns the exception that will be displayed to the user – either the failure of the example or the ‘pending_exception` if the example is pending.

#example_group_instance

Returns the example_group_instance that provides the context for running this example.

#exception

Returns the first exception raised in the context of running this example (nil if no exception is raised).

#metadata

Returns the metadata object associated with this example.

#pending, #pending?, #reporter, #skipped?, #mocks_need_verification?

Instance Method Summary

Example - Inherited

#description

Returns the string submitted to ‘example` or its aliases (e.g. specify, it, etc).

#duplicate_with

Duplicates the example and overrides metadata with the provided hash.

#example_group

Returns the example group class that provides the context for running this example.

#execution_result,
#fail_with_exception

Used internally to set an exception and fail without actually executing the example when an exception is raised in before(:context).

#file_path, #full_description, #id,
#inspect

Provide a human-readable representation of this class.

#inspect_output

Returns a description of the example that always includes the location.

#instance_exec, #location,
#location_rerun_argument

Returns the location-based argument that can be passed to the ‘rspec` command to rerun this example.

#rerun_argument

Returns the location-based argument that can be passed to the ‘rspec` command to rerun this example.

#run

instance_execs the block passed to the constructor in the context of the instance of ExampleGroup.

#set_aggregate_failures_exception

Used to set the exception when ‘aggregate_failures` fails.

#set_exception

Used internally to set an exception in an after hook, which captures the exception but doesn’t raise it.

#skip,
#skip_with_exception

Used internally to skip without actually executing the example when skip is used in before(:context).

#to_s

Alias for Example#inspect.

#update_inherited_metadata, #assign_generated_description, #finish, #generate_description, #hooks, #location_description, #record_finished, #run_after_example, #run_before_example, #start, #verify_mocks, #with_around_and_singleton_context_hooks, #with_around_example_hooks

Instance Method Details

#set_exception(exception)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/example.rb', line 659

def set_exception(exception)
  reporter.notify_non_example_exception(exception, "An error occurred in #{description}.")
  RSpec.world.wants_to_quit = true
end