qsagi 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fd1566a492930270cc3892296d4a9e758a31ed08
4
- data.tar.gz: e13ae0189c47927e52e7c8686cc3c0d087e79467
2
+ SHA256:
3
+ metadata.gz: 86214de8cc8d5656f3f4aa2a3b07b50db7f09700d3480d8bab7f18d24b9796ce
4
+ data.tar.gz: e65636480947e02b0a5fb7533c409ac43f8fd71a044bafbfb8652a781212bb77
5
5
  SHA512:
6
- metadata.gz: 66085d118940a0a6fa01d375467af8c8044ee607211188b22c4c7454fd95cac5a4b79238911a2a34549c6150584865badd31cd16f76ce8247f94a90bea17c830
7
- data.tar.gz: 97d4f26f7060568b565fbed5aa8776ed5ee3105945f4a39b129db37fa19a73d221652b40414efc7086461a18a81ab79e21b9ccaad10b3e153d5ebff53bc57b09
6
+ metadata.gz: 79e5678de21442c5c070b82852e23f1e9082ef8095bea93b85729dd62c2f60bf4b4831705ca2b2a2aecb9e19bde37e2c4e6636f2de50fead4b25b0f800176da5
7
+ data.tar.gz: b771c9e5b46ab38cf537a997b455b79598ce32ae8ae1e654e362edc457c8ee95634c8aec6c76cc6fda620032cba5f7b81dd30cc24e9da75a79178e9c86721a9a
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem "rake", "~> 0.9.2.2"
8
- gem "rspec", "~> 2.11.0"
7
+ gem "rake", "~> 12.3"
8
+ gem "rspec", "~> 3.9"
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Qsagi
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency "bunny", "~> 2.9.2"
21
- gem.add_dependency "json", "~> 1.7"
21
+ gem.add_dependency "json", ">= 1.7"
22
22
  end
@@ -6,28 +6,28 @@ describe Qsagi::ConfirmedQueue do
6
6
  queue = Qsagi::ConfirmedQueue.new(nil)
7
7
  queue.instance_variable_set(:@unconfirmed_messages, {2 => "message"})
8
8
  queue._confirm_messages!(:delivery_tag => 2, :multiple => false, :is_nack => true)
9
- queue.nacked_messages.should == ["message"]
9
+ expect(queue.nacked_messages).to eq(["message"])
10
10
  end
11
11
 
12
12
  it "adds multiple nacked messages to nacked_messages" do
13
13
  queue = Qsagi::ConfirmedQueue.new(nil)
14
14
  queue.instance_variable_set(:@unconfirmed_messages, {2 => "message", 3 => "other_message"})
15
15
  queue._confirm_messages!(:delivery_tag => 3, :multiple => true, :is_nack => true)
16
- queue.nacked_messages.should == ["message", "other_message"]
16
+ expect(queue.nacked_messages).to eq(["message", "other_message"])
17
17
  end
18
18
 
19
19
  it "removes a single acked message from unconfirmed_messages" do
20
20
  queue = Qsagi::ConfirmedQueue.new(nil)
21
21
  queue.instance_variable_set(:@unconfirmed_messages, {2 => "message", 3 => "other_message"})
22
22
  queue._confirm_messages!(:delivery_tag => 2, :multiple => false, :is_nack => false)
23
- queue.instance_variable_get(:@unconfirmed_messages).should == {3 => "other_message"}
23
+ expect(queue.instance_variable_get(:@unconfirmed_messages)).to eq(3 => "other_message")
24
24
  end
25
25
 
26
26
  it "removes multiple acked messages from unconfirmed_messages" do
27
27
  queue = Qsagi::ConfirmedQueue.new(nil)
28
28
  queue.instance_variable_set(:@unconfirmed_messages, {2 => "message", 3 => "other_message", 4 => "this_dude"})
29
29
  queue._confirm_messages!(:delivery_tag => 3, :multiple => true, :is_nack => false)
30
- queue.instance_variable_get(:@unconfirmed_messages).should == {4 => "this_dude"}
30
+ expect(queue.instance_variable_get(:@unconfirmed_messages)).to eq(4 => "this_dude")
31
31
  end
32
32
  end
33
33
  end
@@ -3,13 +3,13 @@ require "spec_helper"
3
3
  describe Qsagi::JsonSerializer do
4
4
  describe "self.deserialize" do
5
5
  it "parses json" do
6
- Qsagi::JsonSerializer.deserialize('{"a": "b"}').should == {"a" => "b"}
6
+ expect(Qsagi::JsonSerializer.deserialize('{"a": "b"}')).to eq("a" => "b")
7
7
  end
8
8
  end
9
9
 
10
10
  describe "self.serialize" do
11
11
  it "parses json" do
12
- Qsagi::JsonSerializer.serialize({"a" => "b"}).should == '{"a":"b"}'
12
+ expect(Qsagi::JsonSerializer.serialize({"a" => "b"})).to eq('{"a":"b"}')
13
13
  end
14
14
  end
15
15
 
@@ -19,7 +19,7 @@ describe Qsagi::JsonSerializer do
19
19
  end
20
20
  json_queue.connect do |queue|
21
21
  queue.push :a => 1
22
- queue.pop.payload.should == {'a' => 1}
22
+ expect(queue.pop.payload).to eq('a' => 1)
23
23
  end
24
24
  end
25
25
  end
@@ -4,20 +4,20 @@ describe Qsagi::Message do
4
4
  describe "delivery_tag" do
5
5
  it "returns the delivery_tag" do
6
6
  delivery_details = OpenStruct.new(:delivery_tag => "tag")
7
- Qsagi::Message.new(delivery_details, :parsed_payload).delivery_tag.should == "tag"
7
+ expect(Qsagi::Message.new(delivery_details, :parsed_payload).delivery_tag).to eq("tag")
8
8
  end
9
9
  end
10
10
 
11
11
  describe "exchange" do
12
12
  it "returns the exchange" do
13
13
  delivery_details = OpenStruct.new(:exchange => "the_exchange")
14
- Qsagi::Message.new(delivery_details, :parsed_payload).exchange.should == "the_exchange"
14
+ expect(Qsagi::Message.new(delivery_details, :parsed_payload).exchange).to eq("the_exchange")
15
15
  end
16
16
  end
17
17
 
18
18
  describe "payload" do
19
19
  it "returns the parsed payload" do
20
- Qsagi::Message.new(:deliver_details, :parsed_payload).payload.should == :parsed_payload
20
+ expect(Qsagi::Message.new(:deliver_details, :parsed_payload).payload).to eq(:parsed_payload)
21
21
  end
22
22
  end
23
23
  end
@@ -5,7 +5,7 @@ describe Qsagi::Queue do
5
5
  ExampleQueue.connect do |queue|
6
6
  queue.push("message")
7
7
  result = queue.pop
8
- result.payload.should == "message"
8
+ expect(result.payload).to eq("message")
9
9
  end
10
10
  end
11
11
 
@@ -22,11 +22,11 @@ describe Qsagi::Queue do
22
22
  end
23
23
  queue_on_exchange1.connect do |queue|
24
24
  message = queue.pop
25
- message.payload.should == "message1"
26
- message.exchange.should == "exchange1"
25
+ expect(message.payload).to eq("message1")
26
+ expect(message.exchange).to eq("exchange1")
27
27
  end
28
28
  queue_on_exchange2.connect do |queue|
29
- queue.pop.should be_nil
29
+ expect(queue.pop).to be_nil
30
30
  end
31
31
  end
32
32
  end
@@ -36,7 +36,7 @@ describe Qsagi::Queue do
36
36
  ExampleQueue.connect do |queue|
37
37
  queue.push("message")
38
38
  queue.clear
39
- queue.pop.should == nil
39
+ expect(queue.pop).to be_nil
40
40
  end
41
41
  end
42
42
  end
@@ -45,11 +45,11 @@ describe Qsagi::Queue do
45
45
  it "returns the number of messages in the queue" do
46
46
  ExampleQueue.connect do |queue|
47
47
  queue.push("message")
48
- queue.length.should == 1
48
+ expect(queue.length).to eq(1)
49
49
  queue.push("message")
50
- queue.length.should == 2
50
+ expect(queue.length).to eq(2)
51
51
  queue.pop
52
- queue.length.should == 1
52
+ expect(queue.length).to eq(1)
53
53
  end
54
54
  end
55
55
  end
@@ -62,7 +62,7 @@ describe Qsagi::Queue do
62
62
  queue.reject(message, :requeue => true)
63
63
  end
64
64
  ExampleQueue.connect do |queue|
65
- queue.length.should == 1
65
+ expect(queue.length).to eq(1)
66
66
  end
67
67
  end
68
68
 
@@ -73,7 +73,7 @@ describe Qsagi::Queue do
73
73
  queue.reject(message, :requeue => false)
74
74
  end
75
75
  ExampleQueue.connect do |queue|
76
- queue.length.should == 0
76
+ expect(queue.length).to eq(0)
77
77
  end
78
78
  end
79
79
  end
@@ -83,11 +83,11 @@ describe Qsagi::Queue do
83
83
  ExampleQueue.connect do |queue|
84
84
  queue.push("message")
85
85
  message = queue.pop
86
- message.payload.should == "message"
86
+ expect(message.payload).to eq("message")
87
87
  end
88
88
  ExampleQueue.connect do |queue|
89
89
  message = queue.pop
90
- message.should == nil
90
+ expect(message).to be_nil
91
91
  end
92
92
  end
93
93
 
@@ -95,16 +95,16 @@ describe Qsagi::Queue do
95
95
  ExampleQueue.connect do |queue|
96
96
  queue.push("message")
97
97
  message = queue.pop(:auto_ack => false)
98
- message.payload.should == "message"
98
+ expect(message.payload).to eq("message")
99
99
  end
100
100
  ExampleQueue.connect do |queue|
101
101
  message = queue.pop(:auto_ack => false)
102
- message.payload.should == "message"
102
+ expect(message.payload).to eq("message")
103
103
  queue.ack(message)
104
104
  end
105
105
  ExampleQueue.connect do |queue|
106
106
  message = queue.pop(:auto_ack => false)
107
- message.should == nil
107
+ expect(message).to be_nil
108
108
  end
109
109
  end
110
110
  end
@@ -114,7 +114,7 @@ describe Qsagi::Queue do
114
114
  ExampleQueue.connect(:queue_type => :confirmed) do |queue|
115
115
  queue.push("message")
116
116
  queue.wait_for_confirms
117
- queue.nacked_messages.size.should == 0
117
+ expect(queue.nacked_messages.size).to eq(0)
118
118
  end
119
119
  end
120
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qsagi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2020-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  description: A friendly way to talk to RabbitMQ
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubyforge_project:
87
- rubygems_version: 2.5.2.1
86
+ rubygems_version: 3.0.8
88
87
  signing_key:
89
88
  specification_version: 4
90
89
  summary: A friendly way to talk to RabbitMQ