spec/lib/consumer_spec.rb in vx-consumer-0.1.4 vs spec/lib/consumer_spec.rb in vx-consumer-0.1.5
- old
+ new
@@ -50,11 +50,11 @@
end
it "pub/sub in multithreaded environment" do
handle_errors do
cns = []
- 30.times do
+ 30.times do |n|
cns << Bob.subscribe
end
90.times do |n|
Thread.new do
@@ -68,10 +68,10 @@
sleep 0.1
end
end
cns.map(&:cancel)
- expect(Bob._collected.map{|c| c["a"] }.sort).to eq((0...90).to_a)
+ expect(Bob._collected.map{|c| c["a"] }.uniq.sort).to eq((0...90).to_a)
end
end
it "should catch errors" do
error = nil