bunny 1.0.7 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +92 -87
- data/lib/amq/protocol/extensions.rb +2 -0
- data/lib/bunny/authentication/credentials_encoder.rb +2 -0
- data/lib/bunny/authentication/external_mechanism_encoder.rb +2 -0
- data/lib/bunny/authentication/plain_mechanism_encoder.rb +2 -0
- data/lib/bunny/channel.rb +485 -186
- data/lib/bunny/channel_id_allocator.rb +8 -4
- data/lib/bunny/concurrent/atomic_fixnum.rb +2 -0
- data/lib/bunny/concurrent/condition.rb +2 -0
- data/lib/bunny/concurrent/continuation_queue.rb +37 -13
- data/lib/bunny/concurrent/synchronized_sorted_set.rb +2 -0
- data/lib/bunny/consumer.rb +20 -13
- data/lib/bunny/consumer_tag_generator.rb +6 -2
- data/lib/bunny/consumer_work_pool.rb +37 -7
- data/lib/bunny/cruby/socket.rb +51 -22
- data/lib/bunny/cruby/ssl_socket.rb +68 -5
- data/lib/bunny/delivery_info.rb +3 -1
- data/lib/bunny/exceptions.rb +27 -4
- data/lib/bunny/exchange.rb +35 -29
- data/lib/bunny/framing.rb +2 -0
- data/lib/bunny/get_response.rb +85 -0
- data/lib/bunny/heartbeat_sender.rb +9 -6
- data/lib/bunny/message_properties.rb +2 -0
- data/lib/bunny/queue.rb +89 -41
- data/lib/bunny/reader_loop.rb +72 -28
- data/lib/bunny/return_info.rb +2 -0
- data/lib/bunny/session.rb +621 -225
- data/lib/bunny/socket.rb +7 -12
- data/lib/bunny/ssl_socket.rb +7 -12
- data/lib/bunny/test_kit.rb +15 -0
- data/lib/bunny/timeout.rb +3 -12
- data/lib/bunny/timestamp.rb +24 -0
- data/lib/bunny/transport.rb +223 -98
- data/lib/bunny/version.rb +2 -1
- data/lib/bunny/versioned_delivery_tag.rb +2 -0
- data/lib/bunny.rb +54 -8
- metadata +38 -224
- data/.gitignore +0 -22
- data/.rspec +0 -3
- data/.ruby-version +0 -1
- data/.travis.yml +0 -23
- data/.yardopts +0 -8
- data/ChangeLog.md +0 -1092
- data/Gemfile +0 -54
- data/LICENSE +0 -21
- data/benchmarks/basic_publish/with_128K_messages.rb +0 -35
- data/benchmarks/basic_publish/with_1k_messages.rb +0 -35
- data/benchmarks/basic_publish/with_4K_messages.rb +0 -35
- data/benchmarks/basic_publish/with_64K_messages.rb +0 -35
- data/benchmarks/channel_open.rb +0 -28
- data/benchmarks/mutex_and_monitor.rb +0 -42
- data/benchmarks/queue_declare.rb +0 -29
- data/benchmarks/queue_declare_and_bind.rb +0 -29
- data/benchmarks/queue_declare_bind_and_delete.rb +0 -29
- data/benchmarks/synchronized_sorted_set.rb +0 -53
- data/benchmarks/write_vs_write_nonblock.rb +0 -49
- data/bin/ci/before_build.sh +0 -31
- data/bunny.gemspec +0 -40
- data/examples/connection/authentication_failure.rb +0 -16
- data/examples/connection/automatic_recovery_with_basic_get.rb +0 -40
- data/examples/connection/automatic_recovery_with_client_named_queues.rb +0 -36
- data/examples/connection/automatic_recovery_with_multiple_consumers.rb +0 -46
- data/examples/connection/automatic_recovery_with_server_named_queues.rb +0 -35
- data/examples/connection/channel_level_exception.rb +0 -35
- data/examples/connection/disabled_automatic_recovery.rb +0 -34
- data/examples/connection/heartbeat.rb +0 -17
- data/examples/connection/manually_reconnecting_consumer.rb +0 -23
- data/examples/connection/manually_reconnecting_publisher.rb +0 -28
- data/examples/connection/unknown_host.rb +0 -16
- data/examples/guides/exchanges/direct_exchange_routing.rb +0 -36
- data/examples/guides/exchanges/fanout_exchange_routing.rb +0 -28
- data/examples/guides/exchanges/headers_exchange_routing.rb +0 -31
- data/examples/guides/exchanges/mandatory_messages.rb +0 -30
- data/examples/guides/extensions/alternate_exchange.rb +0 -28
- data/examples/guides/extensions/basic_nack.rb +0 -33
- data/examples/guides/extensions/connection_blocked.rb +0 -35
- data/examples/guides/extensions/consumer_cancellation_notification.rb +0 -39
- data/examples/guides/extensions/dead_letter_exchange.rb +0 -32
- data/examples/guides/extensions/exchange_to_exchange_bindings.rb +0 -29
- data/examples/guides/extensions/per_message_ttl.rb +0 -36
- data/examples/guides/extensions/per_queue_message_ttl.rb +0 -36
- data/examples/guides/extensions/publisher_confirms.rb +0 -28
- data/examples/guides/extensions/queue_lease.rb +0 -26
- data/examples/guides/extensions/sender_selected_distribution.rb +0 -32
- data/examples/guides/getting_started/blabbr.rb +0 -27
- data/examples/guides/getting_started/hello_world.rb +0 -20
- data/examples/guides/getting_started/weathr.rb +0 -47
- data/examples/guides/queues/one_off_consumer.rb +0 -23
- data/examples/guides/queues/redeliveries.rb +0 -79
- data/lib/bunny/compatibility.rb +0 -24
- data/lib/bunny/concurrent/linked_continuation_queue.rb +0 -61
- data/lib/bunny/jruby/socket.rb +0 -40
- data/lib/bunny/jruby/ssl_socket.rb +0 -53
- data/lib/bunny/system_timer.rb +0 -20
- data/profiling/basic_publish/with_4K_messages.rb +0 -33
- data/repl +0 -3
- data/spec/compatibility/queue_declare_spec.rb +0 -44
- data/spec/compatibility/queue_declare_with_default_channel_spec.rb +0 -33
- data/spec/higher_level_api/integration/basic_ack_spec.rb +0 -71
- data/spec/higher_level_api/integration/basic_cancel_spec.rb +0 -76
- data/spec/higher_level_api/integration/basic_consume_spec.rb +0 -225
- data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +0 -54
- data/spec/higher_level_api/integration/basic_get_spec.rb +0 -48
- data/spec/higher_level_api/integration/basic_nack_spec.rb +0 -79
- data/spec/higher_level_api/integration/basic_publish_spec.rb +0 -89
- data/spec/higher_level_api/integration/basic_qos_spec.rb +0 -29
- data/spec/higher_level_api/integration/basic_recover_spec.rb +0 -18
- data/spec/higher_level_api/integration/basic_reject_spec.rb +0 -74
- data/spec/higher_level_api/integration/basic_return_spec.rb +0 -33
- data/spec/higher_level_api/integration/channel_close_spec.rb +0 -25
- data/spec/higher_level_api/integration/channel_flow_spec.rb +0 -21
- data/spec/higher_level_api/integration/channel_open_spec.rb +0 -57
- data/spec/higher_level_api/integration/confirm_select_spec.rb +0 -19
- data/spec/higher_level_api/integration/connection_spec.rb +0 -400
- data/spec/higher_level_api/integration/connection_stop_spec.rb +0 -26
- data/spec/higher_level_api/integration/consistent_hash_exchange_spec.rb +0 -50
- data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +0 -128
- data/spec/higher_level_api/integration/dead_lettering_spec.rb +0 -52
- data/spec/higher_level_api/integration/exchange_bind_spec.rb +0 -31
- data/spec/higher_level_api/integration/exchange_declare_spec.rb +0 -204
- data/spec/higher_level_api/integration/exchange_delete_spec.rb +0 -105
- data/spec/higher_level_api/integration/exchange_unbind_spec.rb +0 -40
- data/spec/higher_level_api/integration/exclusive_queue_spec.rb +0 -28
- data/spec/higher_level_api/integration/heartbeat_spec.rb +0 -31
- data/spec/higher_level_api/integration/merry_go_round_spec.rb +0 -85
- data/spec/higher_level_api/integration/message_properties_access_spec.rb +0 -95
- data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +0 -24
- data/spec/higher_level_api/integration/publisher_confirms_spec.rb +0 -77
- data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +0 -65
- data/spec/higher_level_api/integration/queue_bind_spec.rb +0 -109
- data/spec/higher_level_api/integration/queue_declare_spec.rb +0 -190
- data/spec/higher_level_api/integration/queue_delete_spec.rb +0 -41
- data/spec/higher_level_api/integration/queue_purge_spec.rb +0 -30
- data/spec/higher_level_api/integration/queue_unbind_spec.rb +0 -54
- data/spec/higher_level_api/integration/read_only_consumer_spec.rb +0 -60
- data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +0 -36
- data/spec/higher_level_api/integration/tls_connection_spec.rb +0 -127
- data/spec/higher_level_api/integration/tx_commit_spec.rb +0 -21
- data/spec/higher_level_api/integration/tx_rollback_spec.rb +0 -21
- data/spec/higher_level_api/integration/with_channel_spec.rb +0 -25
- data/spec/issues/issue100_spec.rb +0 -42
- data/spec/issues/issue141_spec.rb +0 -44
- data/spec/issues/issue78_spec.rb +0 -75
- data/spec/issues/issue83_spec.rb +0 -31
- data/spec/issues/issue97_attachment.json +0 -1
- data/spec/issues/issue97_spec.rb +0 -176
- data/spec/lower_level_api/integration/basic_cancel_spec.rb +0 -69
- data/spec/lower_level_api/integration/basic_consume_spec.rb +0 -100
- data/spec/spec_helper.rb +0 -64
- data/spec/stress/channel_open_stress_spec.rb +0 -51
- data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +0 -28
- data/spec/stress/concurrent_consumers_stress_spec.rb +0 -69
- data/spec/stress/concurrent_publishers_stress_spec.rb +0 -57
- data/spec/stress/connection_open_close_spec.rb +0 -40
- data/spec/stress/long_running_consumer_spec.rb +0 -83
- data/spec/tls/cacert.pem +0 -18
- data/spec/tls/client_cert.pem +0 -18
- data/spec/tls/client_key.pem +0 -27
- data/spec/tls/server_cert.pem +0 -18
- data/spec/tls/server_key.pem +0 -27
- data/spec/unit/bunny_spec.rb +0 -15
- data/spec/unit/concurrent/atomic_fixnum_spec.rb +0 -35
- data/spec/unit/concurrent/condition_spec.rb +0 -82
- data/spec/unit/concurrent/linked_continuation_queue_spec.rb +0 -35
- data/spec/unit/concurrent/synchronized_sorted_set_spec.rb +0 -73
- data/spec/unit/system_timer_spec.rb +0 -10
- data/spec/unit/version_delivery_tag_spec.rb +0 -28
@@ -1,83 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
unless ENV["CI"]
|
5
|
-
require "bunny/concurrent/condition"
|
6
|
-
require "bunny/test_kit"
|
7
|
-
|
8
|
-
describe "Long running [relatively to heartbeat interval] consumer that never publishes" do
|
9
|
-
let(:connection) do
|
10
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :automatic_recovery => false, :heartbeat_interval => 6)
|
11
|
-
c.start
|
12
|
-
c
|
13
|
-
end
|
14
|
-
|
15
|
-
after :all do
|
16
|
-
connection.close
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:target) { 512 * 1024 * 1024 }
|
20
|
-
let(:queue) { "bunny.stress.long_running_consumer.#{Time.now.to_i}" }
|
21
|
-
|
22
|
-
let(:rate) { 50 }
|
23
|
-
let(:s) { 4.0 }
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
it "does not skip heartbeats" do
|
28
|
-
finished = Bunny::Concurrent::Condition.new
|
29
|
-
|
30
|
-
ct = Thread.new do
|
31
|
-
t = 0
|
32
|
-
ch = connection.create_channel(nil, 6)
|
33
|
-
begin
|
34
|
-
q = ch.queue(queue, :exclusive => true)
|
35
|
-
|
36
|
-
q.bind("amq.fanout").subscribe do |_, _, payload|
|
37
|
-
t += payload.bytesize
|
38
|
-
|
39
|
-
if t >= target
|
40
|
-
puts "Hit the target, done with the test..."
|
41
|
-
|
42
|
-
finished.notify_all
|
43
|
-
else
|
44
|
-
puts "Consumed #{(t.to_f / target.to_f).round(3) * 100}% of data"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
rescue Interrupt => e
|
48
|
-
ch.maybe_kill_consumer_work_pool!
|
49
|
-
ch.close
|
50
|
-
end
|
51
|
-
end
|
52
|
-
ct.abort_on_exception = true
|
53
|
-
|
54
|
-
pt = Thread.new do
|
55
|
-
t = 0
|
56
|
-
ch = connection.create_channel
|
57
|
-
begin
|
58
|
-
x = ch.fanout("amq.fanout")
|
59
|
-
|
60
|
-
loop do
|
61
|
-
break if t >= target
|
62
|
-
|
63
|
-
rate.times do |i|
|
64
|
-
msg = Bunny::TestKit.message_in_kb(96, 8192, i)
|
65
|
-
x.publish(msg)
|
66
|
-
t += msg.bytesize
|
67
|
-
end
|
68
|
-
|
69
|
-
sleep (s * rand)
|
70
|
-
end
|
71
|
-
rescue Interrupt => e
|
72
|
-
ch.close
|
73
|
-
end
|
74
|
-
end
|
75
|
-
pt.abort_on_exception = true
|
76
|
-
|
77
|
-
finished.wait
|
78
|
-
|
79
|
-
ct.raise Interrupt.new
|
80
|
-
pt.raise Interrupt.new
|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pHXo6/z9JQJFbYN2MUnfJH4MvTgD8mhgN9uhkLyv+0OHxKlBW03yG5WFq79qaOJt
|
26
|
-
hSMzK/DcwVcntipdBpQWWYw43vIOoX9qKmOBPb9RXcS/26jwEA2KMA==
|
27
|
-
-----END RSA PRIVATE KEY-----
|
data/spec/unit/bunny_spec.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny do
|
4
|
-
it "has library version" do
|
5
|
-
Bunny::VERSION.should_not be_nil
|
6
|
-
Bunny.version.should_not be_nil
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
it "has AMQP protocol version" do
|
11
|
-
Bunny::PROTOCOL_VERSION.should == "0.9.1"
|
12
|
-
AMQ::Protocol::PROTOCOL_VERSION.should == "0.9.1"
|
13
|
-
Bunny.protocol_version.should == "0.9.1"
|
14
|
-
end
|
15
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "bunny/concurrent/atomic_fixnum"
|
3
|
-
|
4
|
-
describe Bunny::Concurrent::AtomicFixnum do
|
5
|
-
it "allows retrieving the current value" do
|
6
|
-
af = described_class.new(0)
|
7
|
-
|
8
|
-
af.get.should == 0
|
9
|
-
af.should == 0
|
10
|
-
end
|
11
|
-
|
12
|
-
it "can be updated" do
|
13
|
-
af = described_class.new(0)
|
14
|
-
|
15
|
-
af.get.should == 0
|
16
|
-
Thread.new do
|
17
|
-
af.set(10)
|
18
|
-
end
|
19
|
-
sleep 0.6
|
20
|
-
af.get.should == 10
|
21
|
-
end
|
22
|
-
|
23
|
-
it "can be incremented" do
|
24
|
-
af = described_class.new(0)
|
25
|
-
|
26
|
-
af.get.should == 0
|
27
|
-
10.times do
|
28
|
-
Thread.new do
|
29
|
-
af.increment
|
30
|
-
end
|
31
|
-
end
|
32
|
-
sleep 0.6
|
33
|
-
af.get.should == 10
|
34
|
-
end
|
35
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "bunny/concurrent/condition"
|
3
|
-
|
4
|
-
describe Bunny::Concurrent::Condition do
|
5
|
-
|
6
|
-
describe "#wait" do
|
7
|
-
100.times do |i|
|
8
|
-
it "blocks current thread until notified (take #{i})" do
|
9
|
-
condition = described_class.new
|
10
|
-
xs = []
|
11
|
-
|
12
|
-
t = Thread.new do
|
13
|
-
xs << :notified
|
14
|
-
|
15
|
-
sleep 0.25
|
16
|
-
condition.notify
|
17
|
-
end
|
18
|
-
t.abort_on_exception = true
|
19
|
-
|
20
|
-
condition.wait
|
21
|
-
xs.should == [:notified]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#notify" do
|
27
|
-
100.times do |i|
|
28
|
-
it "notifies a single thread waiting on the latch (take #{i})" do
|
29
|
-
mutex = Mutex.new
|
30
|
-
condition = described_class.new
|
31
|
-
xs = []
|
32
|
-
|
33
|
-
t1 = Thread.new do
|
34
|
-
condition.wait
|
35
|
-
mutex.synchronize { xs << :notified1 }
|
36
|
-
end
|
37
|
-
t1.abort_on_exception = true
|
38
|
-
|
39
|
-
t2 = Thread.new do
|
40
|
-
condition.wait
|
41
|
-
mutex.synchronize { xs << :notified2 }
|
42
|
-
end
|
43
|
-
t2.abort_on_exception = true
|
44
|
-
|
45
|
-
sleep 0.25
|
46
|
-
condition.notify
|
47
|
-
sleep 0.5
|
48
|
-
xs.should satisfy { |ys| ys.size == 1 && (ys.include?(:notified1) || ys.include?(:notified2)) }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe "#notify_all" do
|
54
|
-
let(:n) { 30 }
|
55
|
-
|
56
|
-
100.times do |i|
|
57
|
-
it "notifies all the threads waiting on the latch (take #{i})" do
|
58
|
-
mutex = Mutex.new
|
59
|
-
condition = described_class.new
|
60
|
-
@xs = []
|
61
|
-
|
62
|
-
n.times do |i|
|
63
|
-
t = Thread.new do
|
64
|
-
condition.wait
|
65
|
-
mutex.synchronize { @xs << "notified#{i + 1}".to_sym }
|
66
|
-
end
|
67
|
-
t.abort_on_exception = true
|
68
|
-
end
|
69
|
-
|
70
|
-
sleep 0.5
|
71
|
-
condition.notify_all
|
72
|
-
sleep 0.5
|
73
|
-
|
74
|
-
n.times do |i|
|
75
|
-
item = "notified#{i + 1}".to_sym
|
76
|
-
|
77
|
-
@xs.should include(item)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
if defined?(JRUBY_VERSION)
|
4
|
-
require "bunny/concurrent/linked_continuation_queue"
|
5
|
-
|
6
|
-
describe Bunny::Concurrent::LinkedContinuationQueue do
|
7
|
-
describe "#poll with a timeout that is never reached" do
|
8
|
-
it "blocks until the value is available, then returns it" do
|
9
|
-
# force subject evaluation
|
10
|
-
cq = subject
|
11
|
-
t = Thread.new do
|
12
|
-
cq.push(10)
|
13
|
-
end
|
14
|
-
t.abort_on_exception = true
|
15
|
-
|
16
|
-
v = subject.poll(500)
|
17
|
-
v.should == 10
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "#poll with a timeout that is reached" do
|
22
|
-
it "raises an exception" do
|
23
|
-
# force subject evaluation
|
24
|
-
cq = subject
|
25
|
-
t = Thread.new do
|
26
|
-
sleep 1.5
|
27
|
-
cq.push(10)
|
28
|
-
end
|
29
|
-
t.abort_on_exception = true
|
30
|
-
|
31
|
-
lambda { subject.poll(500) }.should raise_error(::Timeout::Error)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "bunny/concurrent/synchronized_sorted_set"
|
3
|
-
|
4
|
-
unless ENV["CI"]
|
5
|
-
describe Bunny::Concurrent::SynchronizedSortedSet do
|
6
|
-
50.times do |i|
|
7
|
-
it "provides the same API as SortedSet for key operations (take #{i})" do
|
8
|
-
s = described_class.new
|
9
|
-
s.length.should == 0
|
10
|
-
|
11
|
-
s << 1
|
12
|
-
s.length.should == 1
|
13
|
-
s << 1
|
14
|
-
s.length.should == 1
|
15
|
-
s << 2
|
16
|
-
s.length.should == 2
|
17
|
-
s << 3
|
18
|
-
s.length.should == 3
|
19
|
-
s << 4
|
20
|
-
s.length.should == 4
|
21
|
-
s << 4
|
22
|
-
s << 4
|
23
|
-
s << 4
|
24
|
-
s.length.should == 4
|
25
|
-
s << 5
|
26
|
-
s.length.should == 5
|
27
|
-
s << 5
|
28
|
-
s << 5
|
29
|
-
s << 5
|
30
|
-
s.length.should == 5
|
31
|
-
s << 6
|
32
|
-
s.length.should == 6
|
33
|
-
s << 7
|
34
|
-
s.length.should == 7
|
35
|
-
s << 8
|
36
|
-
s.length.should == 8
|
37
|
-
s.delete 8
|
38
|
-
s.length.should == 7
|
39
|
-
s.delete_if { |i| i == 1 }
|
40
|
-
s.length.should == 6
|
41
|
-
end
|
42
|
-
it "synchronizes common operations needed by Bunny (take #{i})" do
|
43
|
-
s = described_class.new
|
44
|
-
s.length.should == 0
|
45
|
-
|
46
|
-
10.times do
|
47
|
-
Thread.new do
|
48
|
-
s << 1
|
49
|
-
s << 1
|
50
|
-
s << 2
|
51
|
-
s << 3
|
52
|
-
s << 4
|
53
|
-
s << 4
|
54
|
-
s << 4
|
55
|
-
s << 4
|
56
|
-
s << 5
|
57
|
-
s << 5
|
58
|
-
s << 5
|
59
|
-
s << 5
|
60
|
-
s << 6
|
61
|
-
s << 7
|
62
|
-
s << 8
|
63
|
-
s.delete 8
|
64
|
-
s.delete_if { |i| i == 1 }
|
65
|
-
end
|
66
|
-
end
|
67
|
-
sleep 0.5
|
68
|
-
|
69
|
-
s.length.should == 6
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
if RUBY_VERSION.to_f < 1.9
|
4
|
-
describe Bunny::SystemTimer do
|
5
|
-
it 'supports being called with a single argument' do
|
6
|
-
lambda {Bunny::SystemTimer::timeout(1) {}}.should_not raise_error
|
7
|
-
lambda {Bunny::SystemTimer::timeout(1, nil) {}}.should_not raise_error
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
require "bunny/concurrent/atomic_fixnum"
|
4
|
-
require "bunny/versioned_delivery_tag"
|
5
|
-
|
6
|
-
describe Bunny::VersionedDeliveryTag, "#stale?" do
|
7
|
-
subject { described_class.new(2, 1) }
|
8
|
-
|
9
|
-
context "when delivery tag version < provided version" do
|
10
|
-
it "returns true" do
|
11
|
-
subject.stale?(2).should be_true
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context "when delivery tag version = provided version" do
|
16
|
-
it "returns false" do
|
17
|
-
subject.stale?(1).should be_false
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context "when delivery tag version > provided version" do
|
22
|
-
it "returns true" do
|
23
|
-
# this scenario is unrealistic but we still can
|
24
|
-
# unit test it. MK.
|
25
|
-
subject.stale?(0).should be_false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|