bunny 2.6.3 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -3
  3. data/ChangeLog.md +23 -2
  4. data/Gemfile +3 -3
  5. data/LICENSE +1 -1
  6. data/README.md +2 -2
  7. data/lib/bunny/channel.rb +1 -1
  8. data/lib/bunny/channel_id_allocator.rb +3 -3
  9. data/lib/bunny/concurrent/continuation_queue.rb +9 -5
  10. data/lib/bunny/exceptions.rb +6 -0
  11. data/lib/bunny/session.rb +69 -11
  12. data/lib/bunny/transport.rb +1 -1
  13. data/lib/bunny/version.rb +1 -1
  14. data/spec/higher_level_api/integration/basic_ack_spec.rb +46 -46
  15. data/spec/higher_level_api/integration/basic_cancel_spec.rb +13 -13
  16. data/spec/higher_level_api/integration/basic_consume_spec.rb +40 -40
  17. data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +5 -5
  18. data/spec/higher_level_api/integration/basic_get_spec.rb +5 -5
  19. data/spec/higher_level_api/integration/basic_nack_spec.rb +13 -13
  20. data/spec/higher_level_api/integration/basic_publish_spec.rb +7 -7
  21. data/spec/higher_level_api/integration/basic_qos_spec.rb +1 -1
  22. data/spec/higher_level_api/integration/basic_reject_spec.rb +23 -23
  23. data/spec/higher_level_api/integration/basic_return_spec.rb +3 -3
  24. data/spec/higher_level_api/integration/channel_close_spec.rb +1 -1
  25. data/spec/higher_level_api/integration/channel_open_spec.rb +1 -1
  26. data/spec/higher_level_api/integration/connection_recovery_spec.rb +93 -55
  27. data/spec/higher_level_api/integration/connection_spec.rb +46 -46
  28. data/spec/higher_level_api/integration/connection_stop_spec.rb +9 -8
  29. data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +14 -14
  30. data/spec/higher_level_api/integration/dead_lettering_spec.rb +8 -8
  31. data/spec/higher_level_api/integration/exchange_bind_spec.rb +4 -4
  32. data/spec/higher_level_api/integration/exchange_declare_spec.rb +10 -10
  33. data/spec/higher_level_api/integration/exchange_delete_spec.rb +1 -1
  34. data/spec/higher_level_api/integration/exchange_unbind_spec.rb +3 -3
  35. data/spec/higher_level_api/integration/exclusive_queue_spec.rb +5 -5
  36. data/spec/higher_level_api/integration/heartbeat_spec.rb +4 -4
  37. data/spec/higher_level_api/integration/merry_go_round_spec.rb +10 -10
  38. data/spec/higher_level_api/integration/message_properties_access_spec.rb +22 -22
  39. data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +1 -1
  40. data/spec/higher_level_api/integration/publisher_confirms_spec.rb +8 -8
  41. data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +10 -10
  42. data/spec/higher_level_api/integration/queue_bind_spec.rb +10 -10
  43. data/spec/higher_level_api/integration/queue_declare_spec.rb +14 -11
  44. data/spec/higher_level_api/integration/queue_delete_spec.rb +1 -1
  45. data/spec/higher_level_api/integration/queue_purge_spec.rb +3 -3
  46. data/spec/higher_level_api/integration/queue_unbind_spec.rb +4 -4
  47. data/spec/higher_level_api/integration/read_only_consumer_spec.rb +7 -7
  48. data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +6 -6
  49. data/spec/higher_level_api/integration/tls_connection_spec.rb +40 -40
  50. data/spec/higher_level_api/integration/tx_commit_spec.rb +1 -1
  51. data/spec/higher_level_api/integration/tx_rollback_spec.rb +1 -1
  52. data/spec/higher_level_api/integration/with_channel_spec.rb +1 -1
  53. data/spec/issues/issue100_spec.rb +7 -7
  54. data/spec/issues/issue141_spec.rb +3 -3
  55. data/spec/issues/issue224_spec.rb +3 -3
  56. data/spec/issues/issue465_spec.rb +32 -0
  57. data/spec/issues/issue78_spec.rb +11 -10
  58. data/spec/issues/issue83_spec.rb +1 -1
  59. data/spec/issues/issue97_spec.rb +20 -20
  60. data/spec/stress/channel_close_stress_spec.rb +3 -3
  61. data/spec/stress/channel_open_stress_spec.rb +3 -3
  62. data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +2 -1
  63. data/spec/stress/concurrent_consumers_stress_spec.rb +6 -6
  64. data/spec/stress/concurrent_publishers_stress_spec.rb +2 -1
  65. data/spec/stress/connection_open_close_spec.rb +3 -3
  66. data/spec/stress/long_running_consumer_spec.rb +7 -5
  67. data/spec/unit/concurrent/condition_spec.rb +5 -5
  68. metadata +4 -6
  69. data/spec/higher_level_api/integration/basic_recover_spec.rb +0 -18
  70. data/spec/higher_level_api/integration/consistent_hash_exchange_spec.rb +0 -59
@@ -2,14 +2,14 @@ require "spec_helper"
2
2
 
3
3
  describe "A client-named", Bunny::Queue do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
9
9
 
10
10
  it "can be bound to a pre-declared exchange" do
11
11
  ch = connection.create_channel
12
- q = ch.queue("bunny.tests.queues.client-named#{rand}", :exclusive => true)
12
+ q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
13
13
  expect(q).not_to be_server_named
14
14
 
15
15
  expect(q.bind("amq.fanout")).to eq q
@@ -19,7 +19,7 @@ describe "A client-named", Bunny::Queue do
19
19
 
20
20
  it "can be unbound from a pre-declared exchange" do
21
21
  ch = connection.create_channel
22
- q = ch.queue("bunny.tests.queues.client-named#{rand}", :exclusive => true)
22
+ q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
23
23
  expect(q).not_to be_server_named
24
24
 
25
25
  q.bind("amq.fanout")
@@ -30,7 +30,7 @@ describe "A client-named", Bunny::Queue do
30
30
 
31
31
  it "can be bound to a custom exchange" do
32
32
  ch = connection.create_channel
33
- q = ch.queue("bunny.tests.queues.client-named#{rand}", :exclusive => true)
33
+ q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
34
34
 
35
35
  x = ch.fanout("bunny.tests.exchanges.fanout#{rand}")
36
36
  expect(q.bind(x)).to eq q
@@ -41,10 +41,10 @@ describe "A client-named", Bunny::Queue do
41
41
 
42
42
  it "can be unbound from a custom exchange" do
43
43
  ch = connection.create_channel
44
- q = ch.queue("bunny.tests.queues.client-named#{rand}", :exclusive => true)
44
+ q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
45
45
  expect(q).not_to be_server_named
46
46
 
47
- x = ch.fanout("bunny.tests.fanout", :auto_delete => true, :durable => false)
47
+ x = ch.fanout("bunny.tests.fanout", auto_delete: true, durable: false)
48
48
 
49
49
  q.bind(x)
50
50
  expect(q.unbind(x)).to eq q
@@ -64,7 +64,7 @@ describe "A server-named", Bunny::Queue do
64
64
 
65
65
  it "can be bound to a pre-declared exchange" do
66
66
  ch = connection.create_channel
67
- q = ch.queue("", :exclusive => true)
67
+ q = ch.queue("", exclusive: true)
68
68
  expect(q).to be_server_named
69
69
 
70
70
  expect(q.bind("amq.fanout")).to eq q
@@ -74,7 +74,7 @@ describe "A server-named", Bunny::Queue do
74
74
 
75
75
  it "can be unbound from a pre-declared exchange" do
76
76
  ch = connection.create_channel
77
- q = ch.queue("", :exclusive => true)
77
+ q = ch.queue("", exclusive: true)
78
78
  expect(q).to be_server_named
79
79
 
80
80
  q.bind("amq.fanout")
@@ -85,7 +85,7 @@ describe "A server-named", Bunny::Queue do
85
85
 
86
86
  it "can be bound to a custom exchange" do
87
87
  ch = connection.create_channel
88
- q = ch.queue("", :exclusive => true)
88
+ q = ch.queue("", exclusive: true)
89
89
 
90
90
  x = ch.fanout("bunny.tests.exchanges.fanout#{rand}")
91
91
  expect(q.bind(x)).to eq q
@@ -96,7 +96,7 @@ describe "A server-named", Bunny::Queue do
96
96
 
97
97
  it "can be bound from a custom exchange" do
98
98
  ch = connection.create_channel
99
- q = ch.queue("", :exclusive => true)
99
+ q = ch.queue("", exclusive: true)
100
100
 
101
101
  name = "bunny.tests.exchanges.fanout#{rand}"
102
102
  x = ch.fanout(name)
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Queue do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(user: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
@@ -55,7 +55,7 @@ describe Bunny::Queue do
55
55
  it "declares it as durable" do
56
56
  ch = connection.create_channel
57
57
 
58
- q = ch.queue("bunny.tests.queues.durable", :durable => true)
58
+ q = ch.queue("bunny.tests.queues.durable", durable: true)
59
59
  expect(q).to be_durable
60
60
  expect(q).not_to be_auto_delete
61
61
  expect(q).not_to be_exclusive
@@ -71,7 +71,7 @@ describe Bunny::Queue do
71
71
  it "declares it as exclusive" do
72
72
  ch = connection.create_channel
73
73
 
74
- q = ch.queue("bunny.tests.queues.exclusive", :exclusive => true)
74
+ q = ch.queue("bunny.tests.queues.exclusive", exclusive: true)
75
75
  expect(q).to be_exclusive
76
76
  expect(q).not_to be_durable
77
77
  q.delete
@@ -85,7 +85,7 @@ describe Bunny::Queue do
85
85
  it "declares it as auto-delete" do
86
86
  ch = connection.create_channel
87
87
 
88
- q = ch.queue("bunny.tests.queues.auto-delete", :auto_delete => true)
88
+ q = ch.queue("bunny.tests.queues.auto-delete", auto_delete: true)
89
89
  expect(q).to be_auto_delete
90
90
  expect(q).not_to be_exclusive
91
91
  expect(q).not_to be_durable
@@ -101,10 +101,10 @@ describe Bunny::Queue do
101
101
  it "raises an exception" do
102
102
  ch = connection.create_channel
103
103
 
104
- q = ch.queue("bunny.tests.queues.auto-delete", :auto_delete => true, :durable => false)
104
+ q = ch.queue("bunny.tests.queues.auto-delete", auto_delete: true, durable: false)
105
105
  expect {
106
106
  # force re-declaration
107
- ch.queue_declare("bunny.tests.queues.auto-delete", :auto_delete => false, :durable => true)
107
+ ch.queue_declare("bunny.tests.queues.auto-delete", auto_delete: false, durable: true)
108
108
  }.to raise_error(Bunny::PreconditionFailed)
109
109
 
110
110
  expect(ch).to be_closed
@@ -121,7 +121,7 @@ describe Bunny::Queue do
121
121
  it "causes all messages in it to have a TTL" do
122
122
  ch = connection.create_channel
123
123
 
124
- q = ch.queue("bunny.tests.queues.with-arguments.ttl", :arguments => args, :exclusive => true)
124
+ q = ch.queue("bunny.tests.queues.with-arguments.ttl", arguments: args, exclusive: true)
125
125
  expect(q.arguments).to eq args
126
126
 
127
127
  q.publish("xyzzy")
@@ -142,10 +142,13 @@ describe Bunny::Queue do
142
142
  end
143
143
 
144
144
  it "enables priority implementation" do
145
- ch = connection.create_channel
145
+ c = Bunny.new(user: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
146
+ c.start
147
+
148
+ ch = c.create_channel
146
149
  ch.confirm_select
147
150
 
148
- q = ch.queue("bunny.tests.queues.with-arguments.priority", :arguments => args, :exclusive => true)
151
+ q = ch.queue("bunny.tests.queues.with-arguments.priority #{rand}", arguments: args, exclusive: true)
149
152
  expect(q.arguments).to eq args
150
153
 
151
154
  q.publish("xyzzy")
@@ -168,7 +171,7 @@ describe Bunny::Queue do
168
171
  context "when a queue exists" do
169
172
  it "returns true" do
170
173
  ch = connection.create_channel
171
- q = ch.queue("", :exlusive => true)
174
+ q = ch.queue("", exlusive: true)
172
175
 
173
176
  expect(connection.queue_exists?(q.name)).to eq true
174
177
  end
@@ -196,7 +199,7 @@ describe Bunny::Queue do
196
199
  it "causes the queue to be bounded" do
197
200
  ch = connection.create_channel
198
201
 
199
- q = ch.queue("bunny.tests.queues.with-arguments.max-length", :arguments => args, :exclusive => true)
202
+ q = ch.queue("bunny.tests.queues.with-arguments.max-length", arguments: args, exclusive: true)
200
203
  expect(q.arguments).to eq args
201
204
 
202
205
  (n * 10).times do
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Queue, "#delete" do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Queue do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
@@ -15,10 +15,10 @@ describe Bunny::Queue do
15
15
  it "can be purged" do
16
16
  ch = connection.create_channel
17
17
 
18
- q = ch.queue("", :exclusive => true)
18
+ q = ch.queue("", exclusive: true)
19
19
  x = ch.default_exchange
20
20
 
21
- x.publish("xyzzy", :routing_key => q.name)
21
+ x.publish("xyzzy", routing_key: q.name)
22
22
  sleep(0.5)
23
23
 
24
24
  expect(q.message_count).to eq 1
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Queue, "bound to an exchange" do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
@@ -15,7 +15,7 @@ describe Bunny::Queue, "bound to an exchange" do
15
15
  it "can be unbound from an exchange it was bound to" do
16
16
  ch = connection.create_channel
17
17
  x = ch.fanout("amq.fanout")
18
- q = ch.queue("", :exclusive => true).bind(x)
18
+ q = ch.queue("", exclusive: true).bind(x)
19
19
 
20
20
  x.publish("")
21
21
  sleep 0.3
@@ -32,7 +32,7 @@ end
32
32
 
33
33
  describe Bunny::Queue, "NOT bound to an exchange" do
34
34
  let(:connection) do
35
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
35
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
36
36
  c.start
37
37
  c
38
38
  end
@@ -45,7 +45,7 @@ describe Bunny::Queue, "NOT bound to an exchange" do
45
45
  it "is idempotent (succeeds)" do
46
46
  ch = connection.create_channel
47
47
  x = ch.fanout("amq.fanout")
48
- q = ch.queue("", :exclusive => true)
48
+ q = ch.queue("", exclusive: true)
49
49
 
50
50
  # No exception as of RabbitMQ 3.2. MK.
51
51
  q.unbind(x)
@@ -2,13 +2,13 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Queue, "#subscribe" do
4
4
  let(:publisher_connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
9
9
 
10
10
  let(:consumer_connection) do
11
- c = Bunny.new(:user => "bunny_reader", :password => "reader_password", :vhost => "bunny_testbed")
11
+ c = Bunny.new(username: "bunny_reader", password: "reader_password", vhost: "bunny_testbed")
12
12
  c.start
13
13
  c
14
14
  end
@@ -28,7 +28,7 @@ describe Bunny::Queue, "#subscribe" do
28
28
  ch = publisher_connection.create_channel
29
29
  # declare the queue because the read-only user won't be able to issue
30
30
  # queue.declare
31
- q = ch.queue(queue_name, :auto_delete => true, :durable => false)
31
+ q = ch.queue(queue_name, auto_delete: true, durable: false)
32
32
 
33
33
  t = Thread.new do
34
34
  # give the main thread a bit of time to declare the queue
@@ -36,8 +36,8 @@ describe Bunny::Queue, "#subscribe" do
36
36
  ch = consumer_connection.create_channel
37
37
  # this connection is read only, use passive declare to only get
38
38
  # a reference to the queue
39
- q = ch.queue(queue_name, :auto_delete => true, :durable => false, :passive => true)
40
- q.subscribe(:exclusive => false) do |delivery_info, properties, payload|
39
+ q = ch.queue(queue_name, auto_delete: true, durable: false, passive: true)
40
+ q.subscribe(exclusive: false) do |delivery_info, properties, payload|
41
41
  delivered_keys << delivery_info.routing_key
42
42
  delivered_data << payload
43
43
  end
@@ -46,13 +46,13 @@ describe Bunny::Queue, "#subscribe" do
46
46
  sleep 0.5
47
47
 
48
48
  x = ch.default_exchange
49
- x.publish("hello", :routing_key => queue_name)
49
+ x.publish("hello", routing_key: queue_name)
50
50
 
51
51
  sleep 0.7
52
52
  expect(delivered_keys).to include(queue_name)
53
53
  expect(delivered_data).to include("hello")
54
54
 
55
- expect(ch.queue(queue_name, :auto_delete => true, :durable => false).message_count).to eq 0
55
+ expect(ch.queue(queue_name, auto_delete: true, durable: false).message_count).to eq 0
56
56
 
57
57
  ch.close
58
58
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe "Sender-selected distribution" do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end
@@ -14,14 +14,14 @@ describe "Sender-selected distribution" do
14
14
  it "lets publishers specify additional routing keys using CC and BCC headers" do
15
15
  ch = connection.create_channel
16
16
  x = ch.direct("bunny.tests.ssd.exchange")
17
- q1 = ch.queue("", :exclusive => true).bind(x, :routing_key => "one")
18
- q2 = ch.queue("", :exclusive => true).bind(x, :routing_key => "two")
19
- q3 = ch.queue("", :exclusive => true).bind(x, :routing_key => "three")
20
- q4 = ch.queue("", :exclusive => true).bind(x, :routing_key => "four")
17
+ q1 = ch.queue("", exclusive: true).bind(x, routing_key: "one")
18
+ q2 = ch.queue("", exclusive: true).bind(x, routing_key: "two")
19
+ q3 = ch.queue("", exclusive: true).bind(x, routing_key: "three")
20
+ q4 = ch.queue("", exclusive: true).bind(x, routing_key: "four")
21
21
 
22
22
  n = 10
23
23
  n.times do |i|
24
- x.publish("Message #{i}", :routing_key => "one", :headers => {"CC" => ["two", "three"]})
24
+ x.publish("Message #{i}", routing_key: "one", headers: {"CC" => ["two", "three"]})
25
25
  end
26
26
 
27
27
  sleep 0.5
@@ -7,13 +7,13 @@ unless ENV["CI"]
7
7
  expect(connection).to be_tls
8
8
  ch = connection.create_channel
9
9
 
10
- q = ch.queue("", :exclusive => true)
10
+ q = ch.queue("", exclusive: true)
11
11
  x = ch.default_exchange
12
12
 
13
- x.publish("xyzzy", :routing_key => q.name).
14
- publish("xyzzy", :routing_key => q.name).
15
- publish("xyzzy", :routing_key => q.name).
16
- publish("xyzzy", :routing_key => q.name)
13
+ x.publish("xyzzy", routing_key: q.name).
14
+ publish("xyzzy", routing_key: q.name).
15
+ publish("xyzzy", routing_key: q.name).
16
+ publish("xyzzy", routing_key: q.name)
17
17
 
18
18
  sleep 0.5
19
19
  expect(q.message_count).to eq 4
@@ -33,14 +33,14 @@ unless ENV["CI"]
33
33
 
34
34
  describe "TLS connection to RabbitMQ with client certificates" do
35
35
  let(:connection) do
36
- c = Bunny.new(:user => "bunny_gem",
37
- :password => "bunny_password",
38
- :vhost => "bunny_testbed",
39
- :tls => true,
40
- :tls_cert => "spec/tls/client_certificate.pem",
41
- :tls_key => "spec/tls/client_key.pem",
42
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
43
- :verify_peer => false)
36
+ c = Bunny.new(username: "bunny_gem",
37
+ password: "bunny_password",
38
+ vhost: "bunny_testbed",
39
+ tls: true,
40
+ tls_cert: "spec/tls/client_certificate.pem",
41
+ tls_key: "spec/tls/client_key.pem",
42
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
43
+ verify_peer: false)
44
44
  c.start
45
45
  c
46
46
  end
@@ -55,12 +55,12 @@ unless ENV["CI"]
55
55
 
56
56
  describe "TLS connection to RabbitMQ without client certificates" do
57
57
  let(:connection) do
58
- c = Bunny.new(:user => "bunny_gem",
59
- :password => "bunny_password",
60
- :vhost => "bunny_testbed",
61
- :tls => true,
62
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
63
- :verify_peer => false)
58
+ c = Bunny.new(username: "bunny_gem",
59
+ password: "bunny_password",
60
+ vhost: "bunny_testbed",
61
+ tls: true,
62
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
63
+ verify_peer: false)
64
64
  c.start
65
65
  c
66
66
  end
@@ -76,10 +76,10 @@ unless ENV["CI"]
76
76
  describe "TLS connection to RabbitMQ with a connection string" do
77
77
  let(:connection) do
78
78
  c = Bunny.new("amqps://bunny_gem:bunny_password@127.0.0.1/bunny_testbed",
79
- :tls_cert => "spec/tls/client_certificate.pem",
80
- :tls_key => "spec/tls/client_key.pem",
81
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
82
- :verify_peer => false)
79
+ tls_cert: "spec/tls/client_certificate.pem",
80
+ tls_key: "spec/tls/client_key.pem",
81
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
82
+ verify_peer: false)
83
83
  c.start
84
84
  c
85
85
  end
@@ -95,8 +95,8 @@ unless ENV["CI"]
95
95
  describe "TLS connection to RabbitMQ with a connection string and w/o client certificate and key" do
96
96
  let(:connection) do
97
97
  c = Bunny.new("amqps://bunny_gem:bunny_password@127.0.0.1/bunny_testbed",
98
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
99
- :verify_peer => false)
98
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
99
+ verify_peer: false)
100
100
  c.start
101
101
  c
102
102
  end
@@ -111,14 +111,14 @@ unless ENV["CI"]
111
111
 
112
112
  describe "TLS connection to RabbitMQ with client certificates provided inline" do
113
113
  let(:connection) do
114
- c = Bunny.new(:user => "bunny_gem",
115
- :password => "bunny_password",
116
- :vhost => "bunny_testbed",
117
- :tls => true,
118
- :tls_cert => File.read("./spec/tls/client_certificate.pem"),
119
- :tls_key => File.read("./spec/tls/client_key.pem"),
120
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
121
- :verify_peer => false)
114
+ c = Bunny.new(username: "bunny_gem",
115
+ password: "bunny_password",
116
+ vhost: "bunny_testbed",
117
+ tls: true,
118
+ tls_cert: File.read("./spec/tls/client_certificate.pem"),
119
+ tls_key: File.read("./spec/tls/client_key.pem"),
120
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
121
+ verify_peer: false)
122
122
  c.start
123
123
  c
124
124
  end
@@ -132,13 +132,13 @@ unless ENV["CI"]
132
132
 
133
133
  describe "TLS connection to RabbitMQ with tls_version TLSv1 specified" do
134
134
  let(:connection) do
135
- c = Bunny.new(:user => "bunny_gem",
136
- :password => "bunny_password",
137
- :vhost => "bunny_testbed",
138
- :tls => true,
139
- :tls_protocol => :TLSv1,
140
- :tls_ca_certificates => ["./spec/tls/ca_certificate.pem"],
141
- :verify_peer => false)
135
+ c = Bunny.new(username: "bunny_gem",
136
+ password: "bunny_password",
137
+ vhost: "bunny_testbed",
138
+ tls: true,
139
+ tls_protocol: :TLSv1,
140
+ tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
141
+ verify_peer: false)
142
142
  c.start
143
143
  c
144
144
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Bunny::Channel, "#tx_commit" do
4
4
  let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
5
+ c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
6
6
  c.start
7
7
  c
8
8
  end