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.7 spec/spec_queue.rb
right_chimp-2.1.6 spec/spec_queue.rb
right_chimp-2.1.5 spec/spec_queue.rb
right_chimp-2.1.4 spec/spec_queue.rb
right_chimp-2.1.3 spec/spec_queue.rb
right_chimp-2.1.2 spec/spec_queue.rb
right_chimp-2.1.0 spec/spec_queue.rb
right_chimp-2.0.2 spec/spec_queue.rb
right_chimp-2.0.1 spec/spec_queue.rb
right_chimp-2.0 spec/spec_queue.rb
right_chimp-1.1.3 spec/spec_queue.rb
right_chimp-1.1.2 spec/spec_queue.rb
right_chimp-1.1.1 spec/spec_queue.rb
right_chimp-1.1.0 spec/spec_queue.rb
right_chimp-1.0.9 spec/spec_queue.rb
right_chimp-1.0.8 spec/spec_queue.rb
right_chimp-1.0.7 spec/spec_queue.rb
right_chimp-1.0.3 spec/spec_queue.rb
right_chimp-1.0.2 spec/spec_queue.rb
right_chimp-1.0.1 spec/spec_queue.rb