Class: RSpec::Core::SuiteHookContext

Inherits:
Example show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb

Overview

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

Constant Summary

Constants inherited from Example

Example::AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt

Instance Attribute Summary

Attributes inherited from Example

#clock, #example_group_instance, #exception, #metadata, #reporter

Instance Method Summary collapse

Methods inherited from Example

delegate_to_metadata, #description, #display_exception, #display_exception=, #duplicate_with, #example_group, #execution_result, #fail_with_exception, #file_path, #full_description, #id, #inspect, #inspect_output, #instance_exec, #location, #location_rerun_argument, parse_id, #pending, #pending?, #rerun_argument, #run, #set_aggregate_failures_exception, #skip, #skip_with_exception, #skipped?, #update_inherited_metadata

Constructor Details

#initialize(hook_description, reporter) ⇒ SuiteHookContext

Returns a new instance of SuiteHookContext.



652
653
654
655
656
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb', line 652

def initialize(hook_description, reporter)
  super(AnonymousExampleGroup, hook_description, {})
  @example_group_instance = AnonymousExampleGroup.new
  @reporter = reporter
end

Instance Method Details

#set_exception(exception) ⇒ Object

rubocop:disable Naming/AccessorMethodName



659
660
661
662
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/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