Sha256: 530202752e70456eb105a6e4c9d42efbab368176f177139c86e22932c6bc5eac

Contents?: true

Size: 488 Bytes

Versions: 5

Compression:

Stored size: 488 Bytes

Contents

require 'spec_helper'

describe Fwd::Pool do

  subject do
    described_class.new ["A", "B", "C"]
  end

  it { should be_a(Enumerable) }
  its(:to_a) { should == ["C", "B", "A"] }

  it "should round-robin" do
    subject.checkout {|c| c.should == "C" }
    subject.checkout {|c| c.should == "B" }
    subject.checkout {|c| c.should == "A" }
    subject.checkout {|c| c.should == "C" }
    subject.checkout {|c| c.should == "B" }
    subject.checkout {|c| c.should == "A" }
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fwd-0.4.0 spec/fwd/pool_spec.rb
fwd-0.3.3 spec/fwd/pool_spec.rb
fwd-0.3.2 spec/fwd/pool_spec.rb
fwd-0.3.1 spec/fwd/pool_spec.rb
fwd-0.3.0 spec/fwd/pool_spec.rb