Sha256: 4b2ba46c92aea0801e0287bcfbc018ca8a24e1ac67e409ad5aa85e20a608e5b6

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

require 'spec_helper'

class FakeWorker
  include Celluloid
end
class FakeOtherWorker
  include Celluloid
end

describe SuckerPunch::Queue do
  describe ".[]" do
    it "delegates to Celluloid" do
      Celluloid::Actor[:fake] = FakeWorker.pool
      Celluloid::Actor.should_receive(:[]).with(:fake)
      SuckerPunch::Queue[:fake]
    end
  end

  describe "#register" do
    before(:each) do
      SuckerPunch::Queue.new(:crazy_queue).register(FakeWorker, 7)
    end

    it "turns the class into an actor" do
      Celluloid::Actor[:crazy_queue].should be_a(FakeWorker)
      Celluloid::Actor[:crazy_queue].methods.should include(:async)
    end

    it "sets worker size" do
      Celluloid::Actor[:crazy_queue].size.should == 7
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sucker_punch-0.2 spec/queue_spec.rb