msgr 0.15.1.1.b150 → 0.15.1.1.b151
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/msgr/client.rb +1 -1
- data/spec/msgr/msgr/client_spec.rb +59 -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: 6778b5c6cddaa79dc917df83eafce6fe900a90a3
|
4
|
+
data.tar.gz: c592eddd080c9daeacd20ad69fa2d248b49acd24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc358c8cdfabba724fea529758eb1e88b63ea19b32e77793775562000fb34378823272c48bfb93898ac917e119ba5fdabcfecc89a655177ad6767dcd4f995e24
|
7
|
+
data.tar.gz: 5b34cd2c17174287dd4c6bfe2f2ca15ea65447ec6e250c57e9b8f3c9a6b0a16bfdfa251aec4e0f5fe95a565ff8408d23cf1ef828bae8131929a1f2e7e850fa41
|
data/CHANGELOG.md
CHANGED
data/lib/msgr/client.rb
CHANGED
@@ -195,7 +195,7 @@ module Msgr
|
|
195
195
|
config[:pass] ||= uri.password if uri.password
|
196
196
|
config[:host] ||= uri.host if uri.host
|
197
197
|
config[:port] ||= uri.port if uri.port
|
198
|
-
config[:vhost] ||= uri.path
|
198
|
+
config[:vhost] ||= uri.path unless uri.path.empty?
|
199
199
|
config[:ssl] ||= uri.scheme.casecmp('amqps').zero?
|
200
200
|
|
201
201
|
config
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Msgr::Client do
|
5
|
+
subject { described_class.new config }
|
6
|
+
let(:config) { {} }
|
7
|
+
|
8
|
+
describe '#uri' do
|
9
|
+
subject { super().uri.to_s }
|
10
|
+
|
11
|
+
context 'with default config' do
|
12
|
+
it 'uses the default config' do
|
13
|
+
is_expected.to eq 'amqp://127.0.0.1'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'with overwritten URI' do
|
18
|
+
context 'without vhost' do
|
19
|
+
let(:config) { {uri: 'amqp://rabbit'} }
|
20
|
+
|
21
|
+
it 'does not specify a vhost' do
|
22
|
+
is_expected.to eq 'amqp://rabbit'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'with empty vhost' do
|
27
|
+
let(:config) { {uri: 'amqp://rabbit/'} }
|
28
|
+
|
29
|
+
it 'does not specify a vhost' do
|
30
|
+
is_expected.to eq 'amqp://rabbit'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'with explicit vhost' do
|
35
|
+
let(:config) { {uri: 'amqp://rabbit/some_vhost'} }
|
36
|
+
|
37
|
+
# This behavior is due to legacy parsing in Msgr's config.
|
38
|
+
# We interpret the entire path (incl. the leading slash)
|
39
|
+
# as vhost. As per AMQP rules, this means the leading slash
|
40
|
+
# is part of the vhost, which means it has to be URL encoded.
|
41
|
+
# This will likely change with the next major release.
|
42
|
+
it 'uses the entire path as vhost' do
|
43
|
+
is_expected.to eq 'amqp://rabbit/%2Fsome_vhost'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'with URI and vhost' do
|
49
|
+
let(:config) { {uri: 'amqp://rabbit/some_vhost', vhost: 'real_vhost'} }
|
50
|
+
|
51
|
+
# This is currently the only way to specify a vhost without
|
52
|
+
# leading slash (as a vhost in the :uri config would have
|
53
|
+
# an extra URL encoded leading slash).
|
54
|
+
it 'uses the explicit vhost' do
|
55
|
+
is_expected.to eq 'amqp://rabbit/real_vhost'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.1.1.
|
4
|
+
version: 0.15.1.1.b151
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- spec/integration/msgr/railtie_spec.rb
|
138
138
|
- spec/integration/msgr_spec.rb
|
139
139
|
- spec/integration/spec_helper.rb
|
140
|
+
- spec/msgr/msgr/client_spec.rb
|
140
141
|
- spec/msgr/msgr/connection_spec.rb
|
141
142
|
- spec/msgr/msgr/consumer_spec.rb
|
142
143
|
- spec/msgr/msgr/route_spec.rb
|
@@ -199,6 +200,7 @@ test_files:
|
|
199
200
|
- spec/integration/msgr/railtie_spec.rb
|
200
201
|
- spec/integration/msgr_spec.rb
|
201
202
|
- spec/integration/spec_helper.rb
|
203
|
+
- spec/msgr/msgr/client_spec.rb
|
202
204
|
- spec/msgr/msgr/connection_spec.rb
|
203
205
|
- spec/msgr/msgr/consumer_spec.rb
|
204
206
|
- spec/msgr/msgr/route_spec.rb
|