Parent

Class/Module Index [+]

Quicksearch

RSpec::Core::Hooks::HookCollections

@private

Public Class Methods

new(owner, data) click to toggle source
# File lib/rspec/core/hooks.rb, line 450
def initialize(owner, data)
  @owner = owner
  @data  = data
end

Public Instance Methods

[](key) click to toggle source
# File lib/rspec/core/hooks.rb, line 455
def [](key)
  @data[key]
end
around_example_hooks_for(example, initial_procsy=nil) click to toggle source
# File lib/rspec/core/hooks.rb, line 468
def around_example_hooks_for(example, initial_procsy=nil)
  AroundHookCollection.new(FlatMap.flat_map(@owner.parent_groups) do |a|
    a.hooks[:around][:example]
  end).for(example, initial_procsy)
end
register(prepend_or_append, hook, *args, &block) click to toggle source
# File lib/rspec/core/hooks.rb, line 474
def register(prepend_or_append, hook, *args, &block)
  scope, options = scope_and_options_from(*args)
  self[hook][scope].__send__(prepend_or_append, HOOK_TYPES[hook][scope].new(block, options))
end
register_globals(host, globals) click to toggle source
# File lib/rspec/core/hooks.rb, line 459
def register_globals(host, globals)
  process(host, globals, :before, :example)
  process(host, globals, :after,  :example)
  process(host, globals, :around, :example)

  process(host, globals, :before, :context)
  process(host, globals, :after,  :context)
end
run(hook, scope, example_or_group, initial_procsy=nil) click to toggle source

@private

Runs all of the blocks stored with the hook in the context of the example. If no example is provided, just calls the hook directly.

# File lib/rspec/core/hooks.rb, line 483
def run(hook, scope, example_or_group, initial_procsy=nil)
  return if RSpec.configuration.dry_run?
  find_hook(hook, scope, example_or_group, initial_procsy).run
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.