Sha256: e5102c121fcfc6ce137fb3d13268ce81862e5a58eecc88a9aa379219efa8c958
Contents?: true
Size: 630 Bytes
Versions: 12
Compression:
Stored size: 630 Bytes
Contents
# # Specifying rufus-scheduler # # Fri Nov 1 05:56:03 JST 2013 # # Ishinomaki # require 'spec_helper' describe Rufus::Scheduler do class LosingLockScheduler < Rufus::Scheduler attr_reader :counter def initialize super @counter = 0 end def confirm_lock @counter = @counter + 1 false end end context 'custom locks' do it 'does not trigger when #confirm_lock returns false' do s = LosingLockScheduler.new count = 0 s.in('0s') { count = count + 1 } sleep 0.7 expect(count).to eq(0) expect(s.counter).to eq(1) end end end
Version data entries
12 entries across 12 versions & 1 rubygems