Sha256: 735d69dcbaea648bfc727a64870f91c928a9a8bb5351f85b8771ebffb96a3cda

Contents?: true

Size: 610 Bytes

Versions: 53

Compression:

Stored size: 610 Bytes

Contents

# encoding: utf-8
require "spec_helper"
require "logstash/util/wrapped_synchronous_queue"

describe LogStash::Util::WrappedSynchronousQueue do
 context "#offer" do
   context "queue is blocked" do
     it "fails and give feedback" do
       expect(subject.offer("Bonjour", 2)).to be_falsey
     end
   end

   context "queue is not blocked" do
     before do
       @consumer = Thread.new { loop { subject.take } }
       sleep(0.1)
     end

     after do
       @consumer.kill
     end
     
     it "inserts successfully" do
       expect(subject.offer("Bonjour", 20)).to be_truthy
     end
   end
 end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/spec/logstash/util/wrapped_synchronous_queue_spec.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/logstash-core-2.4.1-java/spec/logstash/util/wrapped_synchronous_queue_spec.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/logstash-core-2.4.1-java/spec/logstash/util/wrapped_synchronous_queue_spec.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/logstash-core-2.4.1-java/spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.1-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.0-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.0.snapshot4-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.0.snapshot3-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.0.snapshot2-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.4.0.snapshot1-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.3.4-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.3.4.snapshot1-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-5.0.0.alpha4.snapshot3-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-5.0.0.alpha4.snapshot2-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.3.3-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-2.3.3.snapshot2-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-5.0.0.alpha4.snapshot1-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-5.0.0.alpha3-java spec/logstash/util/wrapped_synchronous_queue_spec.rb
logstash-core-5.0.0.alpha3.snapshot8-java spec/logstash/util/wrapped_synchronous_queue_spec.rb