Module: EventedSpec::SpecHelper::EventMachineHelpers::GroupMethods
- Included in:
- GroupMethods
- Defined in:
- lib/evented-spec/spec_helper/event_machine_helpers.rb
Instance Method Summary collapse
-
#em_after(scope = :each) { ... } ⇒ Object
Adds after hook that will run inside EM event loop after example finishes.
-
#em_before(scope = :each) { ... } ⇒ Object
Adds before hook that will run inside EM event loop before example starts.
Instance Method Details
#em_after(scope = :each) { ... } ⇒ Object
Adds after hook that will run inside EM event loop after example finishes.
18 19 20 21 |
# File 'lib/evented-spec/spec_helper/event_machine_helpers.rb', line 18 def em_after(scope = :each, &block) raise ArgumentError, "em_after only supports :each scope" unless :each == scope evented_spec_hooks_for(:em_after).unshift block end |
#em_before(scope = :each) { ... } ⇒ Object
Adds before hook that will run inside EM event loop before example starts.
9 10 11 12 |
# File 'lib/evented-spec/spec_helper/event_machine_helpers.rb', line 9 def em_before(scope = :each, &block) raise ArgumentError, "em_before only supports :each scope" unless :each == scope evented_spec_hooks_for(:em_before) << block end |