amq-protocol 1.9.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/ChangeLog.md +15 -1
- data/Gemfile +3 -2
- data/LICENSE +1 -1
- data/README.md +7 -4
- data/amq-protocol.gemspec +5 -7
- data/lib/amq/protocol/constants.rb +1 -0
- data/lib/amq/protocol/table_value_encoder.rb +4 -4
- data/lib/amq/protocol/version.rb +1 -1
- data/lib/amq/uri.rb +3 -5
- data/spec/amq/bit_set_spec.rb +40 -40
- data/spec/amq/int_allocator_spec.rb +25 -25
- data/spec/amq/pack_spec.rb +5 -5
- data/spec/amq/protocol/basic_spec.rb +58 -58
- data/spec/amq/protocol/blank_body_encoding_spec.rb +2 -2
- data/spec/amq/protocol/channel_spec.rb +22 -22
- data/spec/amq/protocol/confirm_spec.rb +5 -5
- data/spec/amq/protocol/connection_spec.rb +21 -21
- data/spec/amq/protocol/constants_spec.rb +4 -4
- data/spec/amq/protocol/exchange_spec.rb +10 -10
- data/spec/amq/protocol/frame_spec.rb +18 -18
- data/spec/amq/protocol/method_spec.rb +8 -8
- data/spec/amq/protocol/queue_spec.rb +15 -15
- data/spec/amq/protocol/table_spec.rb +50 -57
- data/spec/amq/protocol/tx_spec.rb +6 -6
- data/spec/amq/protocol/value_decoder_spec.rb +18 -18
- data/spec/amq/protocol/value_encoder_spec.rb +41 -41
- data/spec/amq/protocol_spec.rb +174 -174
- data/spec/amq/settings_spec.rb +4 -4
- data/spec/amq/uri_parsing_spec.rb +33 -33
- data/spec/spec_helper.rb +2 -9
- metadata +14 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6414473e47857ea1786e17fc043ccb0a7de1c51e
|
4
|
+
data.tar.gz: 7e20dca497dd7b785a62fbf4f1edd8efde84ffda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc68b493add7ea27adf4451631bd1137377e6f979feb43e834f48b8ab019688fdad5f726893bb1de9dbbc4a29948f47d4e7fcbd1607b3fea123f594e267fbd29
|
7
|
+
data.tar.gz: ca3c1f251925c4bbee125e5b7556579129d00557847b79e797fb780f863bb18ff839f2f773e4e8aa339261f1ade985fdfb27402721dce4f15ca2ddc8cdb77bc3
|
data/.travis.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
-
## Changes between 1.9.x and
|
1
|
+
## Changes between 1.9.x and 2.0.0
|
2
|
+
|
3
|
+
2.0.0 has **breaking changes** in header encoding.
|
4
|
+
|
5
|
+
### Signed Integer Encoding in Headers
|
6
|
+
|
7
|
+
Integer values in headers are now encoded as signed 64-bit
|
8
|
+
(was unsigned 32-bit previously, unintentionally).
|
9
|
+
|
10
|
+
This is a breaking change: consuming messages with integers in headers
|
11
|
+
published with older versions of this library will break!
|
2
12
|
|
3
13
|
### Signed 16 Bit Integer Decoding
|
4
14
|
|
5
15
|
Signed 16 bit integers are now decoded correctly.
|
6
16
|
|
17
|
+
### Signed 8 Bit Integer Decoding
|
18
|
+
|
19
|
+
Signed 8 bit integers are now decoded correctly.
|
20
|
+
|
7
21
|
Contributed by Benjamin Conlan.
|
8
22
|
|
9
23
|
|
data/Gemfile
CHANGED
@@ -4,12 +4,13 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
group :development do
|
6
6
|
# excludes Windows, Rubinius and JRuby
|
7
|
-
gem "ruby-prof", :
|
7
|
+
gem "ruby-prof", :platforms => [:mri_19, :mri_20, :mri_21]
|
8
8
|
|
9
9
|
gem "rake"
|
10
10
|
end
|
11
11
|
|
12
12
|
group :test do
|
13
|
-
gem "rspec"
|
13
|
+
gem "rspec"
|
14
|
+
gem "rspec-its"
|
14
15
|
gem "effin_utf8"
|
15
16
|
end
|
data/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Copyright (c) 2010 – 2011 Jakub Šťastný aka Botanicus
|
2
|
-
Copyright (c) 2011 –
|
2
|
+
Copyright (c) 2011 – 2015 Michael S. Klishin <michael@defprotocol.org>
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -7,6 +7,13 @@ If you want to write your own AMQP client, this gem will handle all the serializ
|
|
7
7
|
needs for you, including RabbitMQ extensions to AMQP 0.9.1.
|
8
8
|
|
9
9
|
|
10
|
+
## Supported Ruby Versions
|
11
|
+
|
12
|
+
amq-protocol `1.9.2` was the last version to support Ruby 1.8 and 1.9.
|
13
|
+
|
14
|
+
amq-protocol `2.0.0` and later will only support Ruby 2.0+.
|
15
|
+
|
16
|
+
|
10
17
|
## Installation
|
11
18
|
|
12
19
|
gem install amq-protocol
|
@@ -56,7 +63,3 @@ Any questions you may have should be sent to the [Ruby AMQP mailing list](http:/
|
|
56
63
|
## License
|
57
64
|
|
58
65
|
MIT (see LICENSE in the repository root).
|
59
|
-
|
60
|
-
|
61
|
-
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ruby-amqp/amq-protocol/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
62
|
-
|
data/amq-protocol.gemspec
CHANGED
@@ -10,14 +10,14 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = AMQ::Protocol::VERSION
|
11
11
|
s.authors = ["Jakub Stastny", "Michael S. Klishin", "Theo Hultberg", "Mark Abramov"]
|
12
12
|
s.homepage = "http://github.com/ruby-amqp/amq-protocol"
|
13
|
-
s.summary = "AMQP 0.9.1
|
13
|
+
s.summary = "AMQP 0.9.1 encoding & decoding library."
|
14
14
|
s.description = <<-DESC
|
15
|
-
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not
|
16
|
-
|
17
|
-
If you want to write your own AMQP client, this gem can help you with that.
|
15
|
+
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not a
|
16
|
+
client: the library only handles serialization and deserialization.
|
18
17
|
DESC
|
19
|
-
s.email = ["
|
18
|
+
s.email = ["michael.s.klishin@gmail.com"]
|
20
19
|
s.licenses = ["MIT"]
|
20
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.0")
|
21
21
|
|
22
22
|
# files
|
23
23
|
s.files = `git ls-files`.split("\n").reject { |file| file =~ /^vendor\// }
|
@@ -25,7 +25,5 @@ Gem::Specification.new do |s|
|
|
25
25
|
|
26
26
|
s.extra_rdoc_files = ["README.md"] + Dir.glob("doc/*")
|
27
27
|
|
28
|
-
|
29
|
-
# RubyForge
|
30
28
|
s.rubyforge_project = "amq-protocol"
|
31
29
|
end
|
@@ -36,8 +36,8 @@ module AMQ
|
|
36
36
|
accumulator << [v.bytesize].pack(PACK_UINT32)
|
37
37
|
accumulator << v
|
38
38
|
when Integer then
|
39
|
-
accumulator <<
|
40
|
-
accumulator << [value].pack(
|
39
|
+
accumulator << TYPE_SIGNED_64BIT
|
40
|
+
accumulator << [value].pack(PACK_INT64_BE)
|
41
41
|
when AMQ::Protocol::Float32Bit then
|
42
42
|
accumulator << TYPE_32BIT_FLOAT
|
43
43
|
accumulator << [value.value].pack(PACK_32BIT_FLOAT)
|
@@ -49,7 +49,7 @@ module AMQ
|
|
49
49
|
accumulator << (value ? BOOLEAN_TRUE : BOOLEAN_FALSE)
|
50
50
|
when Time then
|
51
51
|
accumulator << TYPE_TIME
|
52
|
-
accumulator << [value.to_i].pack(
|
52
|
+
accumulator << [value.to_i].pack(PACK_INT64_BE)
|
53
53
|
when nil then
|
54
54
|
accumulator << TYPE_VOID
|
55
55
|
when Array then
|
@@ -91,7 +91,7 @@ module AMQ
|
|
91
91
|
when String then
|
92
92
|
acc += (value.bytesize + 4)
|
93
93
|
when Integer then
|
94
|
-
acc +=
|
94
|
+
acc += 8
|
95
95
|
when Float then
|
96
96
|
acc += 8
|
97
97
|
when Time, DateTime then
|
data/lib/amq/protocol/version.rb
CHANGED
data/lib/amq/uri.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require "amq/settings"
|
4
|
-
|
5
3
|
require "cgi"
|
6
4
|
require "uri"
|
7
5
|
|
@@ -18,14 +16,14 @@ module AMQ
|
|
18
16
|
opts = {}
|
19
17
|
|
20
18
|
opts[:scheme] = uri.scheme
|
21
|
-
opts[:user] = ::
|
22
|
-
opts[:pass] = ::
|
19
|
+
opts[:user] = ::CGI::unescape(uri.user) if uri.user
|
20
|
+
opts[:pass] = ::CGI::unescape(uri.password) if uri.password
|
23
21
|
opts[:host] = uri.host if uri.host
|
24
22
|
opts[:port] = uri.port || AMQP_PORTS[uri.scheme]
|
25
23
|
opts[:ssl] = uri.scheme.to_s.downcase =~ /amqps/i
|
26
24
|
if uri.path =~ %r{^/(.*)}
|
27
25
|
raise ArgumentError.new("#{uri} has multiple-segment path; please percent-encode any slashes in the vhost name (e.g. /production => %2Fproduction). Learn more at http://bit.ly/amqp-gem-and-connection-uris") if $1.index('/')
|
28
|
-
opts[:vhost] = ::
|
26
|
+
opts[:vhost] = ::CGI::unescape($1)
|
29
27
|
end
|
30
28
|
|
31
29
|
opts
|
data/spec/amq/bit_set_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe AMQ::BitSet do
|
|
23
23
|
it "has no bits set at the start" do
|
24
24
|
bs = AMQ::BitSet.new(128)
|
25
25
|
0.upto(127) do |i|
|
26
|
-
bs[i].
|
26
|
+
expect(bs[i]).to be_falsey
|
27
27
|
end
|
28
28
|
end # it
|
29
29
|
end # describe
|
@@ -33,15 +33,15 @@ describe AMQ::BitSet do
|
|
33
33
|
described_class.new(nbits)
|
34
34
|
end
|
35
35
|
it "returns 0 when the word is between 0 and 63" do
|
36
|
-
subject.word_index(0).
|
37
|
-
subject.word_index(63).
|
36
|
+
expect(subject.word_index(0)).to eq(0)
|
37
|
+
expect(subject.word_index(63)).to eq(0)
|
38
38
|
end # it
|
39
39
|
it "returns 1 when the word is between 64 and 127" do
|
40
|
-
subject.word_index(64).
|
41
|
-
subject.word_index(127).
|
40
|
+
expect(subject.word_index(64)).to be(1)
|
41
|
+
expect(subject.word_index(127)).to be(1)
|
42
42
|
end # it
|
43
43
|
it "returns 2 when the word is between 128 and another number" do
|
44
|
-
subject.word_index(128).
|
44
|
+
expect(subject.word_index(128)).to be(2)
|
45
45
|
end # it
|
46
46
|
end # describe
|
47
47
|
|
@@ -54,7 +54,7 @@ describe AMQ::BitSet do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "returns true" do
|
57
|
-
subject.get(3).
|
57
|
+
expect(subject.get(3)).to be_truthy
|
58
58
|
end # it
|
59
59
|
end # describe
|
60
60
|
|
@@ -64,7 +64,7 @@ describe AMQ::BitSet do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "returns false" do
|
67
|
-
subject.get(5).
|
67
|
+
expect(subject.get(5)).to be_falsey
|
68
68
|
end # it
|
69
69
|
end # describe
|
70
70
|
|
@@ -74,10 +74,10 @@ describe AMQ::BitSet do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should raise IndexError for negative index" do
|
77
|
-
|
77
|
+
expect { subject.get(-1) }.to raise_error(IndexError)
|
78
78
|
end # it
|
79
79
|
it "should raise IndexError for index >= number of bits" do
|
80
|
-
|
80
|
+
expect { subject.get(nbits) }.to raise_error(IndexError)
|
81
81
|
end # it
|
82
82
|
end # describe
|
83
83
|
end # describe
|
@@ -91,9 +91,9 @@ describe AMQ::BitSet do
|
|
91
91
|
|
92
92
|
it "has no effect" do
|
93
93
|
subject.set(3)
|
94
|
-
subject.get(3).
|
94
|
+
expect(subject.get(3)).to be_truthy
|
95
95
|
subject.set(3)
|
96
|
-
subject[3].
|
96
|
+
expect(subject[3]).to be_truthy
|
97
97
|
end # it
|
98
98
|
end # describe
|
99
99
|
|
@@ -104,13 +104,13 @@ describe AMQ::BitSet do
|
|
104
104
|
|
105
105
|
it "sets that bit" do
|
106
106
|
subject.set(3)
|
107
|
-
subject.get(3).
|
107
|
+
expect(subject.get(3)).to be_truthy
|
108
108
|
|
109
109
|
subject.set(33)
|
110
|
-
subject.get(33).
|
110
|
+
expect(subject.get(33)).to be_truthy
|
111
111
|
|
112
112
|
subject.set(3387)
|
113
|
-
subject.get(3387).
|
113
|
+
expect(subject.get(3387)).to be_truthy
|
114
114
|
end # it
|
115
115
|
end # describe
|
116
116
|
|
@@ -120,10 +120,10 @@ describe AMQ::BitSet do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
it "should raise IndexError for negative index" do
|
123
|
-
|
123
|
+
expect { subject.set(-1) }.to raise_error(IndexError)
|
124
124
|
end # it
|
125
125
|
it "should raise IndexError for index >= number of bits" do
|
126
|
-
|
126
|
+
expect { subject.set(nbits) }.to raise_error(IndexError)
|
127
127
|
end # it
|
128
128
|
end # describe
|
129
129
|
end # describe
|
@@ -137,9 +137,9 @@ describe AMQ::BitSet do
|
|
137
137
|
|
138
138
|
it "unsets that bit" do
|
139
139
|
subject.set(3)
|
140
|
-
subject.get(3).
|
140
|
+
expect(subject.get(3)).to be_truthy
|
141
141
|
subject.unset(3)
|
142
|
-
subject.get(3).
|
142
|
+
expect(subject.get(3)).to be_falsey
|
143
143
|
end # it
|
144
144
|
end # describe
|
145
145
|
|
@@ -150,9 +150,9 @@ describe AMQ::BitSet do
|
|
150
150
|
end
|
151
151
|
|
152
152
|
it "has no effect" do
|
153
|
-
subject.get(3).
|
153
|
+
expect(subject.get(3)).to be_falsey
|
154
154
|
subject.unset(3)
|
155
|
-
subject.get(3).
|
155
|
+
expect(subject.get(3)).to be_falsey
|
156
156
|
end # it
|
157
157
|
end # describe
|
158
158
|
|
@@ -162,10 +162,10 @@ describe AMQ::BitSet do
|
|
162
162
|
end
|
163
163
|
|
164
164
|
it "should raise IndexError for negative index" do
|
165
|
-
|
165
|
+
expect { subject.unset(-1) }.to raise_error(IndexError)
|
166
166
|
end # it
|
167
167
|
it "should raise IndexError for index >= number of bits" do
|
168
|
-
|
168
|
+
expect { subject.unset(nbits) }.to raise_error(IndexError)
|
169
169
|
end # it
|
170
170
|
end # describe
|
171
171
|
end # describe
|
@@ -179,25 +179,25 @@ describe AMQ::BitSet do
|
|
179
179
|
|
180
180
|
it "clears all bits" do
|
181
181
|
subject.set(3)
|
182
|
-
subject.get(3).
|
182
|
+
expect(subject.get(3)).to be_truthy
|
183
183
|
|
184
184
|
subject.set(7668)
|
185
|
-
subject.get(7668).
|
185
|
+
expect(subject.get(7668)).to be_truthy
|
186
186
|
|
187
187
|
subject.clear
|
188
188
|
|
189
|
-
subject.get(3).
|
190
|
-
subject.get(7668).
|
189
|
+
expect(subject.get(3)).to be_falsey
|
190
|
+
expect(subject.get(7668)).to be_falsey
|
191
191
|
end # it
|
192
192
|
end # describe
|
193
193
|
|
194
194
|
describe "#number_of_trailing_ones" do
|
195
195
|
it "calculates them" do
|
196
|
-
described_class.number_of_trailing_ones(0).
|
197
|
-
described_class.number_of_trailing_ones(1).
|
198
|
-
described_class.number_of_trailing_ones(2).
|
199
|
-
described_class.number_of_trailing_ones(3).
|
200
|
-
described_class.number_of_trailing_ones(4).
|
196
|
+
expect(described_class.number_of_trailing_ones(0)).to eq(0)
|
197
|
+
expect(described_class.number_of_trailing_ones(1)).to eq(1)
|
198
|
+
expect(described_class.number_of_trailing_ones(2)).to eq(0)
|
199
|
+
expect(described_class.number_of_trailing_ones(3)).to eq(2)
|
200
|
+
expect(described_class.number_of_trailing_ones(4)).to eq(0)
|
201
201
|
end # it
|
202
202
|
end # describe
|
203
203
|
|
@@ -206,27 +206,27 @@ describe AMQ::BitSet do
|
|
206
206
|
described_class.new(255)
|
207
207
|
end
|
208
208
|
it "returns sequential values when none have been returned" do
|
209
|
-
subject.next_clear_bit.
|
209
|
+
expect(subject.next_clear_bit).to eq(0)
|
210
210
|
subject.set(0)
|
211
|
-
subject.next_clear_bit.
|
211
|
+
expect(subject.next_clear_bit).to eq(1)
|
212
212
|
subject.set(1)
|
213
|
-
subject.next_clear_bit.
|
213
|
+
expect(subject.next_clear_bit).to eq(2)
|
214
214
|
subject.unset(1)
|
215
|
-
subject.next_clear_bit.
|
215
|
+
expect(subject.next_clear_bit).to eq(1)
|
216
216
|
end # it
|
217
217
|
|
218
218
|
it "returns the same number as long as nothing is set" do
|
219
|
-
subject.next_clear_bit.
|
220
|
-
subject.next_clear_bit.
|
219
|
+
expect(subject.next_clear_bit).to eq(0)
|
220
|
+
expect(subject.next_clear_bit).to eq(0)
|
221
221
|
end # it
|
222
222
|
|
223
223
|
it "handles more than 128 bits" do
|
224
224
|
0.upto(254) do |i|
|
225
225
|
subject.set(i)
|
226
|
-
subject.next_clear_bit.
|
226
|
+
expect(subject.next_clear_bit).to eq(i + 1)
|
227
227
|
end
|
228
228
|
subject.unset(254)
|
229
|
-
subject.get(254).
|
229
|
+
expect(subject.get(254)).to be_falsey
|
230
230
|
end # it
|
231
231
|
end # describe
|
232
232
|
end
|
@@ -23,20 +23,20 @@ describe AMQ::IntAllocator do
|
|
23
23
|
|
24
24
|
describe "#number_of_bits" do
|
25
25
|
it "returns number of bits available for allocation" do
|
26
|
-
subject.number_of_bits.
|
26
|
+
expect(subject.number_of_bits).to eq(4)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
|
31
31
|
describe "#hi" do
|
32
32
|
it "returns upper bound of the allocation range" do
|
33
|
-
subject.hi.
|
33
|
+
expect(subject.hi).to eq(5)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
describe "#lo" do
|
38
38
|
it "returns lower bound of the allocation range" do
|
39
|
-
subject.lo.
|
39
|
+
expect(subject.lo).to eq(1)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -44,12 +44,12 @@ describe AMQ::IntAllocator do
|
|
44
44
|
describe "#allocate" do
|
45
45
|
context "when integer in the range is available" do
|
46
46
|
it "returns allocated integer" do
|
47
|
-
subject.allocate.
|
48
|
-
subject.allocate.
|
49
|
-
subject.allocate.
|
50
|
-
subject.allocate.
|
47
|
+
expect(subject.allocate).to eq(1)
|
48
|
+
expect(subject.allocate).to eq(2)
|
49
|
+
expect(subject.allocate).to eq(3)
|
50
|
+
expect(subject.allocate).to eq(4)
|
51
51
|
|
52
|
-
subject.allocate.
|
52
|
+
expect(subject.allocate).to eq(-1)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -57,10 +57,10 @@ describe AMQ::IntAllocator do
|
|
57
57
|
it "returns -1" do
|
58
58
|
4.times { subject.allocate }
|
59
59
|
|
60
|
-
subject.allocate.
|
61
|
-
subject.allocate.
|
62
|
-
subject.allocate.
|
63
|
-
subject.allocate.
|
60
|
+
expect(subject.allocate).to eq(-1)
|
61
|
+
expect(subject.allocate).to eq(-1)
|
62
|
+
expect(subject.allocate).to eq(-1)
|
63
|
+
expect(subject.allocate).to eq(-1)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -70,24 +70,24 @@ describe AMQ::IntAllocator do
|
|
70
70
|
context "when the integer WAS allocated" do
|
71
71
|
it "returns frees that integer" do
|
72
72
|
4.times { subject.allocate }
|
73
|
-
subject.allocate.
|
73
|
+
expect(subject.allocate).to eq(-1)
|
74
74
|
|
75
75
|
subject.free(1)
|
76
|
-
subject.allocate.
|
77
|
-
subject.allocate.
|
76
|
+
expect(subject.allocate).to eq(1)
|
77
|
+
expect(subject.allocate).to eq(-1)
|
78
78
|
subject.free(2)
|
79
|
-
subject.allocate.
|
80
|
-
subject.allocate.
|
79
|
+
expect(subject.allocate).to eq(2)
|
80
|
+
expect(subject.allocate).to eq(-1)
|
81
81
|
subject.free(3)
|
82
|
-
subject.allocate.
|
83
|
-
subject.allocate.
|
82
|
+
expect(subject.allocate).to eq(3)
|
83
|
+
expect(subject.allocate).to eq(-1)
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
context "when the integer WAS NOT allocated" do
|
88
88
|
it "has no effect" do
|
89
89
|
32.times { subject.free(1) }
|
90
|
-
subject.allocate.
|
90
|
+
expect(subject.allocate).to eq(1)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -98,9 +98,9 @@ describe AMQ::IntAllocator do
|
|
98
98
|
it "returns true" do
|
99
99
|
3.times { subject.allocate }
|
100
100
|
|
101
|
-
subject.allocated?(1).
|
102
|
-
subject.allocated?(2).
|
103
|
-
subject.allocated?(3).
|
101
|
+
expect(subject.allocated?(1)).to be_truthy
|
102
|
+
expect(subject.allocated?(2)).to be_truthy
|
103
|
+
expect(subject.allocated?(3)).to be_truthy
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
@@ -108,8 +108,8 @@ describe AMQ::IntAllocator do
|
|
108
108
|
it "returns false" do
|
109
109
|
2.times { subject.allocate }
|
110
110
|
|
111
|
-
subject.allocated?(3).
|
112
|
-
subject.allocated?(4).
|
111
|
+
expect(subject.allocated?(3)).to be_falsey
|
112
|
+
expect(subject.allocated?(4)).to be_falsey
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|