Sha256: fadd618118a8c51ce4e710ede1ab36d8b2a1a3bb2420171fea294499d9eaec6e

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require "spec_helper"
require "bunny/concurrent/synchronized_sorted_set"

describe Bunny::Concurrent::SynchronizedSortedSet do
  it "synchronizes common operations needed by Bunny" do
    s = described_class.new
    s.length.should == 0

    10.times do
      Thread.new do
        s << 1
        s << 1
        s << 2
        s << 3
        s << 4
        s << 4
        s << 4
        s << 4
        s << 5
        s << 5
        s << 5
        s << 5
        s << 6
        s << 7
        s << 8
        s.delete 8
        s.delete_if { |i| i == 1 }
      end
    end
    sleep 2.0

    s.length.should == 6
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bunny-0.10.0 spec/unit/concurrent/synchronized_sorted_set_spec.rb
bunny-1.0.0.pre3 spec/unit/concurrent/synchronized_sorted_set_spec.rb