Sha256: f2b2172f6d1c0daa82b8f5d491e84d767d24cc05a6d3287d0f4b452fee3abca4

Contents?: true

Size: 794 Bytes

Versions: 41

Compression:

Stored size: 794 Bytes

Contents

#
# Test ChimpQueue
#

require 'lib/right_chimp.rb'
require 'rspec'

include Chimp

describe ChimpQueue do
  before :all do
    @queue = ChimpQueue.instance
    @queue.max_threads = 3
    @queue.start
  end
  
  before :each do
    @queue.reset!
  end
  
  it "should accept work" do
    @queue.push(:default, ExecNoop.new(:job_id => 0))
    @queue.group[:default].get_job(0).status.should == Executor::STATUS_NONE
  end
  
  it "should distribute work" do
    @queue.push(:default, ExecNoop.new(:job_id => 0))
    @queue.shift.status.should == Executor::STATUS_NONE
  end
  
  it "should process the queue" do
    @queue.push(:default, ExecNoop.new(:job_id => 0))
    @queue.wait_until_done(:default) { }
    @queue.group[:default].get_job(0).status.should == Executor::STATUS_DONE
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
right_chimp-2.1.28 spec/spec_queue.rb
right_chimp-2.1.27 spec/spec_queue.rb
right_chimp-2.1.26 spec/spec_queue.rb
right_chimp-2.1.25.2 spec/spec_queue.rb
right_chimp-2.1.25 spec/spec_queue.rb
right_chimp-2.1.24 spec/spec_queue.rb
right_chimp-2.1.22.2 spec/spec_queue.rb
right_chimp-2.1.22.1 spec/spec_queue.rb
right_chimp-2.1.22 spec/spec_queue.rb
right_chimp-2.1.21 spec/spec_queue.rb
right_chimp-2.1.19.1 spec/spec_queue.rb
right_chimp-2.1.19 spec/spec_queue.rb
right_chimp-2.1.18 spec/spec_queue.rb
right_chimp-2.1.17 spec/spec_queue.rb
right_chimp-2.1.15 spec/spec_queue.rb
right_chimp-2.1.14 spec/spec_queue.rb
right_chimp-2.1.13 spec/spec_queue.rb
right_chimp-2.1.12 spec/spec_queue.rb
right_chimp-2.1.10 spec/spec_queue.rb
right_chimp-2.1.8 spec/spec_queue.rb