Class: RSpec::Core::Hooks::HookCollection
- Inherits:
-
Array
- Object
- Array
- RSpec::Core::Hooks::HookCollection
- Defined in:
- lib/rspec/core/hooks.rb
Instance Method Summary collapse
Instance Method Details
#for(example_or_group) ⇒ Object
52 53 54 55 |
# File 'lib/rspec/core/hooks.rb', line 52 def for(example_or_group) self.class.new(select {|hook| hook.(example_or_group)}). with(example_or_group) end |
#run ⇒ Object
62 63 64 |
# File 'lib/rspec/core/hooks.rb', line 62 def run each {|h| h.run(@example) } unless empty? end |
#with(example) ⇒ Object
57 58 59 60 |
# File 'lib/rspec/core/hooks.rb', line 57 def with(example) @example = example self end |