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

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

Direct Known Subclasses

AfterHooks, AroundHooks, BeforeHooks

Instance Method Summary collapse

Instance Method Details

#find_hooks_for(example_or_group) ⇒ Object


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

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

#without_hooks_for(example_or_group) ⇒ Object


63
64
65
# File 'lib/rspec/core/hooks.rb', line 63

def without_hooks_for(example_or_group)
  self.class.new(reject {|hook| hook.options_apply?(example_or_group)})
end