amq-protocol 1.9.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.should_not be_nil
10
- AMQ::Settings.default[:host].should_not be_nil
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].should eql("tagadab")
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].should eql("tagadab")
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].should be_nil # in this case, default / will be used
20
- val[:host].should == "dev.rabbitmq.com"
21
- val[:port].should == 5672
22
- val[:scheme].should == "amqp"
23
- val[:ssl].should be_false
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].should be_nil
30
- val[:host].should == "dev.rabbitmq.com"
31
- val[:port].should == 5671
32
- val[:scheme].should == "amqps"
33
- val[:ssl].should be_true
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].should == "dev.rabbitmq.com"
42
- val[:port].should == 5672
43
- val[:scheme].should == "amqp"
44
- val[:ssl].should be_false
45
- val[:vhost].should == ""
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].should == "dev.rabbitmq.com"
55
- val[:port].should == 5672
56
- val[:scheme].should == "amqp"
57
- val[:ssl].should be_false
58
- val[:vhost].should == "/vault"
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].should == "dev.rabbitmq.com"
68
- val[:port].should == 5672
69
- val[:scheme].should == "amqp"
70
- val[:ssl].should be_false
71
- val[:vhost].should == "a.path.without.slashes"
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
- lambda { described_class.parse_amqp_url("amqp://dev.rabbitmq.com/a/path/with/slashes") }.should raise_error(ArgumentError)
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].should == "hub.megacorp.internal"
87
- val[:port].should == 5672
88
- val[:scheme].should == "amqp"
89
- val[:ssl].should be_false
90
- val[:user].should == "hedgehog"
91
- val[:pass].should == "t0ps3kr3t"
92
- val[:vhost].should be_nil # in this case, default / will be used
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.include(RubyVersionsSupport)
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: 1.9.2
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: 2013-12-20 00:00:00.000000000 Z
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 an
18
- AMQP client: amq-protocol only handles serialization and deserialization.
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@novemberain.com
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.1.11
105
+ rubygems_version: 2.4.8
108
106
  signing_key:
109
107
  specification_version: 4
110
- summary: AMQP 0.9.1 encoder & decoder.
108
+ summary: AMQP 0.9.1 encoding & decoding library.
111
109
  test_files: []
112
110
  has_rdoc: