Module: EMSpecHelper
- Defined in:
- lib/onapp/engine/spec/em_helper.rb
Defined Under Namespace
Classes: Timer
Instance Method Summary (collapse)
Instance Method Details
- (Object) em_test_mode!
13 14 15 16 17 18 19 20 21 |
# File 'lib/onapp/engine/spec/em_helper.rb', line 13 def em_test_mode! allow(EM).to receive(:add_periodic_timer) do |*args, &block| timer = Timer.new(*args, &block) em_timers << timer timer end allow(EM).to receive(:defer) { |&block| block.call } end |
- (Object) em_timers
23 24 25 |
# File 'lib/onapp/engine/spec/em_helper.rb', line 23 def em_timers @em_timers ||= [] end |