Sha256: d049df0d7e6c734d86177fd21b30407b4c355fdac1380e1f4886c5feb6b0b894

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

require 'helper'

describe Scales::Queue::Sync do
  
  it "should place a few jobs" do
    Scales::Queue::Sync.add "job 1"
    Scales::Queue::Sync.add "job 2"
    Scales::Queue::Sync.add "job 3"
  end

  it "should take them out blocking" do
    Scales::Queue::Sync.pop.should == "job 1"
    Scales::Queue::Sync.pop.should == "job 2"
    Scales::Queue::Sync.pop.should == "job 3"
  end
  
end

describe Scales::Queue::Async do
  
  it "should place a few jobs" do
    async do
      Scales::Queue::Async.add "job 1"
      Scales::Queue::Async.add "job 2"
      Scales::Queue::Async.add "job 3"
    end
  end

  it "should take them out blocking" do
    async do
      Scales::Queue::Async.pop.should == "job 1"
      Scales::Queue::Async.pop.should == "job 2"
      Scales::Queue::Async.pop.should == "job 3"
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scales-core-0.0.1.beta.2 spec/queue_spec.rb
scales-core-0.0.1.beta.1 spec/queue_spec.rb