bunny 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +8 -0
- data/lib/bunny/concurrent/atomic_fixnum.rb +1 -0
- data/lib/bunny/version.rb +1 -1
- data/lib/bunny/versioned_delivery_tag.rb +3 -3
- data/spec/unit/version_delivery_tag_spec.rb +28 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65bba4f160af1169e1e2d7f1e15045dad3fafb21
|
4
|
+
data.tar.gz: 38db4dd54e20cd407012b4e81da4a537585fe7db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 180fcfdee5da277fb7d4e7d1249cfd0dda89f62539f3da1c669591468fc1b3a93d69e66334756aa151187ee799401b57648a04e99f0addaafc06f3409f7ac6ad
|
7
|
+
data.tar.gz: 56906a33ce0109360cb65cfce44aed78bb0ae7c100369e4bda8f7531aa4153ba69fda011b8d4b699718b5590ab8460f46ae5355ee4fec5cb33f6c5ef63771d5c
|
data/ChangeLog.md
CHANGED
data/lib/bunny/version.rb
CHANGED
@@ -11,8 +11,8 @@ module Bunny
|
|
11
11
|
raise ArgumentError.new("tag cannot be nil") unless tag
|
12
12
|
raise ArgumentError.new("version cannot be nil") unless version
|
13
13
|
|
14
|
-
@tag = tag
|
15
|
-
@version = version
|
14
|
+
@tag = tag.to_i
|
15
|
+
@version = version.to_i
|
16
16
|
end
|
17
17
|
|
18
18
|
def to_i
|
@@ -22,7 +22,7 @@ module Bunny
|
|
22
22
|
def stale?(version)
|
23
23
|
raise ArgumentError.new("version cannot be nil") unless version
|
24
24
|
|
25
|
-
@version < version
|
25
|
+
@version < version.to_i
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,28 @@
|
|
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
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Duncan
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-11-
|
15
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: amq-protocol
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- spec/unit/concurrent/linked_continuation_queue_spec.rb
|
204
204
|
- spec/unit/concurrent/synchronized_sorted_set_spec.rb
|
205
205
|
- spec/unit/system_timer_spec.rb
|
206
|
+
- spec/unit/version_delivery_tag_spec.rb
|
206
207
|
homepage: http://rubybunny.info
|
207
208
|
licenses:
|
208
209
|
- MIT
|
@@ -297,4 +298,5 @@ test_files:
|
|
297
298
|
- spec/unit/concurrent/linked_continuation_queue_spec.rb
|
298
299
|
- spec/unit/concurrent/synchronized_sorted_set_spec.rb
|
299
300
|
- spec/unit/system_timer_spec.rb
|
301
|
+
- spec/unit/version_delivery_tag_spec.rb
|
300
302
|
has_rdoc: true
|