Class: RSpec::Core::Hooks::HookCollection

Inherits:
Array
  • Object
show all
Includes:
HookCollectionAliases
Defined in:
lib/rspec/core/hooks.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) for(example_or_group)



55
56
57
58
# File 'lib/rspec/core/hooks.rb', line 55

def for(example_or_group)
  self.class.new(select {|hook| hook.options_apply?(example_or_group)}).
    with(example_or_group)
end

- (Object) run



65
66
67
# File 'lib/rspec/core/hooks.rb', line 65

def run
  each {|h| h.run(@example) } unless empty?
end

- (Object) with(example)



60
61
62
63
# File 'lib/rspec/core/hooks.rb', line 60

def with(example)
  @example = example
  self
end