Class: RSpec::Core::Hooks::AroundHookCollection
- Inherits:
-
Array
- Object
- Array
- RSpec::Core::Hooks::AroundHookCollection
- Includes:
- HookCollectionAliases
- Defined in:
- lib/rspec/core/hooks.rb
Instance Method Summary collapse
Instance Method Details
#for(example, initial_procsy = nil) ⇒ Object
79 80 81 82 |
# File 'lib/rspec/core/hooks.rb', line 79 def for(example, initial_procsy=nil) self.class.new(select {|hook| hook.(example)}). with(example, initial_procsy) end |
#run ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/rspec/core/hooks.rb', line 90 def run inject(@initial_procsy) do |procsy, around_hook| Example.procsy(procsy.) do @example.instance_eval_with_args(procsy, &around_hook) end end.call end |
#with(example, initial_procsy) ⇒ Object
84 85 86 87 88 |
# File 'lib/rspec/core/hooks.rb', line 84 def with(example, initial_procsy) @example = example @initial_procsy = initial_procsy self end |