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
data/spec/amq/settings_spec.rb
CHANGED
@@ -6,20 +6,20 @@ require "amq/settings"
|
|
6
6
|
describe AMQ::Settings do
|
7
7
|
describe ".default" do
|
8
8
|
it "should provide some default values" do
|
9
|
-
AMQ::Settings.default.
|
10
|
-
AMQ::Settings.default[:host].
|
9
|
+
expect(AMQ::Settings.default).to_not be_nil
|
10
|
+
expect(AMQ::Settings.default[:host]).to_not be_nil
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
describe ".configure(&block)" do
|
15
15
|
it "should merge custom settings with default settings" do
|
16
16
|
settings = AMQ::Settings.configure(:host => "tagadab")
|
17
|
-
settings[:host].
|
17
|
+
expect(settings[:host]).to eql("tagadab")
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should merge custom settings from AMQP URL with default settings" do
|
21
21
|
settings = AMQ::Settings.configure("amqp://tagadab")
|
22
|
-
settings[:host].
|
22
|
+
expect(settings[:host]).to eql("tagadab")
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -16,21 +16,21 @@ describe AMQ::URI, ".parse" do
|
|
16
16
|
it "handles amqp:// URIs w/o path part" do
|
17
17
|
val = described_class.parse_amqp_url("amqp://dev.rabbitmq.com")
|
18
18
|
|
19
|
-
val[:vhost].
|
20
|
-
val[:host].
|
21
|
-
val[:port].
|
22
|
-
val[:scheme].
|
23
|
-
val[:ssl].
|
19
|
+
expect(val[:vhost]).to be_nil # in this case, default / will be used
|
20
|
+
expect(val[:host]).to eq("dev.rabbitmq.com")
|
21
|
+
expect(val[:port]).to eq(5672)
|
22
|
+
expect(val[:scheme]).to eq("amqp")
|
23
|
+
expect(val[:ssl]).to be_falsey
|
24
24
|
end
|
25
25
|
|
26
26
|
it "handles amqps:// URIs w/o path part" do
|
27
27
|
val = described_class.parse_amqp_url("amqps://dev.rabbitmq.com")
|
28
28
|
|
29
|
-
val[:vhost].
|
30
|
-
val[:host].
|
31
|
-
val[:port].
|
32
|
-
val[:scheme].
|
33
|
-
val[:ssl].
|
29
|
+
expect(val[:vhost]).to be_nil
|
30
|
+
expect(val[:host]).to eq("dev.rabbitmq.com")
|
31
|
+
expect(val[:port]).to eq(5671)
|
32
|
+
expect(val[:scheme]).to eq("amqps")
|
33
|
+
expect(val[:ssl]).to be_truthy
|
34
34
|
end
|
35
35
|
|
36
36
|
|
@@ -38,11 +38,11 @@ describe AMQ::URI, ".parse" do
|
|
38
38
|
it "parses vhost as an empty string" do
|
39
39
|
val = described_class.parse_amqp_url("amqp://dev.rabbitmq.com/")
|
40
40
|
|
41
|
-
val[:host].
|
42
|
-
val[:port].
|
43
|
-
val[:scheme].
|
44
|
-
val[:ssl].
|
45
|
-
val[:vhost].
|
41
|
+
expect(val[:host]).to eq("dev.rabbitmq.com")
|
42
|
+
expect(val[:port]).to eq(5672)
|
43
|
+
expect(val[:scheme]).to eq("amqp")
|
44
|
+
expect(val[:ssl]).to be_falsey
|
45
|
+
expect(val[:vhost]).to eq("")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -51,11 +51,11 @@ describe AMQ::URI, ".parse" do
|
|
51
51
|
it "parses vhost as /vault" do
|
52
52
|
val = described_class.parse_amqp_url("amqp://dev.rabbitmq.com/%2Fvault")
|
53
53
|
|
54
|
-
val[:host].
|
55
|
-
val[:port].
|
56
|
-
val[:scheme].
|
57
|
-
val[:ssl].
|
58
|
-
val[:vhost].
|
54
|
+
expect(val[:host]).to eq("dev.rabbitmq.com")
|
55
|
+
expect(val[:port]).to eq(5672)
|
56
|
+
expect(val[:scheme]).to eq("amqp")
|
57
|
+
expect(val[:ssl]).to be_falsey
|
58
|
+
expect(val[:vhost]).to eq("/vault")
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -64,17 +64,17 @@ describe AMQ::URI, ".parse" do
|
|
64
64
|
it "parses vhost as a.path.without.slashes" do
|
65
65
|
val = described_class.parse_amqp_url("amqp://dev.rabbitmq.com/a.path.without.slashes")
|
66
66
|
|
67
|
-
val[:host].
|
68
|
-
val[:port].
|
69
|
-
val[:scheme].
|
70
|
-
val[:ssl].
|
71
|
-
val[:vhost].
|
67
|
+
expect(val[:host]).to eq("dev.rabbitmq.com")
|
68
|
+
expect(val[:port]).to eq(5672)
|
69
|
+
expect(val[:scheme]).to eq("amqp")
|
70
|
+
expect(val[:ssl]).to be_falsey
|
71
|
+
expect(val[:vhost]).to eq("a.path.without.slashes")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
context "when URI is amqp://dev.rabbitmq.com/a/path/with/slashes" do
|
76
76
|
it "raises an ArgumentError" do
|
77
|
-
|
77
|
+
expect { described_class.parse_amqp_url("amqp://dev.rabbitmq.com/a/path/with/slashes") }.to raise_error(ArgumentError)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -83,13 +83,13 @@ describe AMQ::URI, ".parse" do
|
|
83
83
|
it "parses them out" do
|
84
84
|
val = described_class.parse_amqp_url("amqp://hedgehog:t0ps3kr3t@hub.megacorp.internal")
|
85
85
|
|
86
|
-
val[:host].
|
87
|
-
val[:port].
|
88
|
-
val[:scheme].
|
89
|
-
val[:ssl].
|
90
|
-
val[:user].
|
91
|
-
val[:pass].
|
92
|
-
val[:vhost].
|
86
|
+
expect(val[:host]).to eq("hub.megacorp.internal")
|
87
|
+
expect(val[:port]).to eq(5672)
|
88
|
+
expect(val[:scheme]).to eq("amqp")
|
89
|
+
expect(val[:ssl]).to be_falsey
|
90
|
+
expect(val[:user]).to eq("hedgehog")
|
91
|
+
expect(val[:pass]).to eq("t0ps3kr3t")
|
92
|
+
expect(val[:vhost]).to be_nil # in this case, default / will be used
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'bundler/setup'
|
4
4
|
require 'rspec'
|
5
|
+
require 'rspec/its'
|
5
6
|
|
6
7
|
require "effin_utf8"
|
7
8
|
|
@@ -20,16 +21,8 @@ require "amq/protocol"
|
|
20
21
|
|
21
22
|
puts "Running on #{RUBY_VERSION}"
|
22
23
|
|
23
|
-
module RubyVersionsSupport
|
24
|
-
def one_point_eight?
|
25
|
-
RUBY_VERSION =~ /^1.8/
|
26
|
-
end
|
27
|
-
end # RubyVersionsSUpport
|
28
|
-
|
29
|
-
|
30
24
|
RSpec.configure do |config|
|
31
25
|
config.include AMQ::Protocol
|
32
26
|
|
33
|
-
config.
|
34
|
-
config.extend(RubyVersionsSupport)
|
27
|
+
config.warnings = true
|
35
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Stastny
|
@@ -11,24 +11,22 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2015-08-15 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |2
|
17
|
-
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not
|
18
|
-
|
19
|
-
If you want to write your own AMQP client, this gem can help you with that.
|
17
|
+
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not a
|
18
|
+
client: the library only handles serialization and deserialization.
|
20
19
|
email:
|
21
|
-
- michael@
|
22
|
-
- stastny@101ideas.cz
|
20
|
+
- michael.s.klishin@gmail.com
|
23
21
|
executables: []
|
24
22
|
extensions: []
|
25
23
|
extra_rdoc_files:
|
26
24
|
- README.md
|
27
25
|
files:
|
28
|
-
- .gitignore
|
29
|
-
- .gitmodules
|
30
|
-
- .rspec
|
31
|
-
- .travis.yml
|
26
|
+
- ".gitignore"
|
27
|
+
- ".gitmodules"
|
28
|
+
- ".rspec"
|
29
|
+
- ".travis.yml"
|
32
30
|
- ChangeLog.md
|
33
31
|
- Gemfile
|
34
32
|
- LICENSE
|
@@ -94,19 +92,19 @@ require_paths:
|
|
94
92
|
- lib
|
95
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
94
|
requirements:
|
97
|
-
- -
|
95
|
+
- - ">="
|
98
96
|
- !ruby/object:Gem::Version
|
99
|
-
version: '0'
|
97
|
+
version: '2.0'
|
100
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
99
|
requirements:
|
102
|
-
- -
|
100
|
+
- - ">="
|
103
101
|
- !ruby/object:Gem::Version
|
104
102
|
version: '0'
|
105
103
|
requirements: []
|
106
104
|
rubyforge_project: amq-protocol
|
107
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.4.8
|
108
106
|
signing_key:
|
109
107
|
specification_version: 4
|
110
|
-
summary: AMQP 0.9.1
|
108
|
+
summary: AMQP 0.9.1 encoding & decoding library.
|
111
109
|
test_files: []
|
112
110
|
has_rdoc:
|