Class: RSpec::Core::Hooks::AfterAllHook

Inherits:
Hook
  • Object
show all
Defined in:
lib/rspec/core/hooks.rb

Instance Attribute Summary

Attributes inherited from Hook

#block, #options

Instance Method Summary collapse

Methods inherited from Hook

#initialize, #options_apply?

Constructor Details

This class inherits a constructor from RSpec::Core::Hooks::Hook

Instance Method Details

#display_nameObject



53
54
55
# File 'lib/rspec/core/hooks.rb', line 53

def display_name
  "after(:all) hook"
end

#run(example) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rspec/core/hooks.rb', line 40

def run(example)
  example.instance_exec(example, &block)
rescue Exception => e
  # TODO: come up with a better solution for this.
  RSpec.configuration.reporter.message <<-EOS

An error occurred in an after(:all) hook.
  #{e.class}: #{e.message}
  occurred at #{e.backtrace.first}

EOS
end