Module: EventedSpec::SpecHelper::EventMachineHelpers::ExampleMethods
- Included in:
- EventedSpec::SpecHelper
- Defined in:
- lib/evented-spec/spec_helper/event_machine_helpers.rb
Overview
module GroupMethods
Instance Method Summary collapse
-
#em(opts = {}) { ... } ⇒ Object
Yields to block inside EM loop, :spec_timeout option (in seconds) is used to force spec to timeout if something goes wrong and EM/AMQP loop hangs for some reason.
Instance Method Details
#em(opts = {}) { ... } ⇒ Object
Yields to block inside EM loop, :spec_timeout option (in seconds) is used to force spec to timeout if something goes wrong and EM/AMQP loop hangs for some reason.
For compatibility with EM-Spec API, em method accepts either options Hash or numeric timeout in seconds.
35 36 37 38 39 |
# File 'lib/evented-spec/spec_helper/event_machine_helpers.rb', line 35 def em(opts = {}, &block) opts = .merge(opts.is_a?(Hash) ? opts : { :spec_timeout => opts }) @evented_example = EMExample.new(opts, self, &block) @evented_example.run end |