spec/scheduler_spec.rb in rufus-scheduler-3.0.1 vs spec/scheduler_spec.rb in rufus-scheduler-3.0.2

- old
+ new

@@ -152,11 +152,11 @@ @scheduler.shutdown lambda { @scheduler.in('0s') { puts 'hhhhhhhhhhhello!!' } - }.should raise_error(RuntimeError) + }.should raise_error(Rufus::Scheduler::NotRunningError) end end describe '#in / #at' do @@ -371,40 +371,42 @@ end it 'lists all the work threads in the pool' do @scheduler.in '0s' do - # nada + sleep(0.2) end @scheduler.in '0s' do - sleep(2) + sleep(2.0) end sleep 0.6 @scheduler.work_threads.size.should == 2 + @scheduler.work_threads(:all).size.should == 2 end end describe '#work_threads(:vacant)' do it 'returns an empty array when the scheduler has not yet done anything' do @scheduler.work_threads(:vacant).should == [] end - it 'lists all the work threads in the pool' do + it 'lists all the vacant work threads in the pool' do @scheduler.in '0s' do - # nada + sleep(0.2) end @scheduler.in '0s' do - sleep(2) + sleep(2.0) end - sleep 0.4 + sleep 0.6 + @scheduler.work_threads(:all).size.should == 2 @scheduler.work_threads(:vacant).size.should == 1 end end describe '#work_threads(:active)' do @@ -450,11 +452,11 @@ end end #describe '#min_work_threads' do # it 'returns the min job thread count' do - # @scheduler.min_work_threads.should == 7 + # @scheduler.min_work_threads.should == 3 # end #end #describe '#min_work_threads=' do # it 'sets the min job thread count' do # @scheduler.min_work_threads = 1 @@ -464,10 +466,10 @@ describe '#max_work_threads' do it 'returns the max job thread count' do - @scheduler.max_work_threads.should == 35 + @scheduler.max_work_threads.should == 28 end end describe '#max_work_threads=' do