module RSpec::Core::Hooks

def run_hook(hook, scope, example=nil, options={})

example. If no example is provided, just calls the hook directly.
Runs all of the blocks stored with the hook in the context of the
def run_hook(hook, scope, example=nil, options={})
  if options[:reverse]
    hooks[hook][scope].reverse.each &run_hook_in(example)
  else
    hooks[hook][scope].each &run_hook_in(example)
  end
end