Sha256: 2e0b88c66d7bfd96bcc68815c0f8ec09b7a1d4083fca40a0796c7268f0faa6bd
Contents?: true
Size: 880 Bytes
Versions: 47
Compression:
Stored size: 880 Bytes
Contents
require "spec_helper" if defined?(JRUBY_VERSION) require "bunny/concurrent/linked_continuation_queue" describe Bunny::Concurrent::LinkedContinuationQueue do describe "#poll with a timeout that is never reached" do it "blocks until the value is available, then returns it" do # force subject evaluation cq = subject t = Thread.new do cq.push(10) end t.abort_on_exception = true v = subject.poll(500) expect(v).to eq 10 end end describe "#poll with a timeout that is reached" do it "raises an exception" do # force subject evaluation cq = subject t = Thread.new do sleep 1.5 cq.push(10) end t.abort_on_exception = true expect { subject.poll(500) }.to raise_error(::Timeout::Error) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems