amq-protocol 0.0.1.pre → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ # encoding: binary
2
+
3
+ require File.expand_path('../../../spec_helper', __FILE__)
4
+
5
+
6
+ module AMQ
7
+ module Protocol
8
+ describe Method do
9
+ describe '.split_headers' do
10
+ it 'splits user defined headers into properties and headers' do
11
+ input = {:delivery_mode => 2, :content_type => 'application/octet-stream', :foo => 'bar'}
12
+ properties, headers = Method.split_headers(input)
13
+ properties.should == {:delivery_mode => 2, :content_type => 'application/octet-stream'}
14
+ headers.should == {:foo => 'bar'}
15
+ end
16
+ end
17
+
18
+ describe '.encode_body' do
19
+ context 'when the body fits in a single frame' do
20
+ it 'encodes a body into a BodyFrame' do
21
+ body_frames = Method.encode_body('Hello world', 1, 131072)
22
+ body_frames.first.payload.should == 'Hello world'
23
+ body_frames.first.channel.should == 1
24
+ body_frames.should have(1).item
25
+ end
26
+ end
27
+
28
+ context 'when the body is to big to fit in a single frame' do
29
+ it 'encodes a body into a list of BodyFrames that each fit within the frame size' do
30
+ lipsum = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
31
+ frame_size = 100
32
+ expected_payload_size = 93
33
+ body_frames = Method.encode_body(lipsum, 1, frame_size)
34
+ body_frames.map(&:payload).should == lipsum.split('').each_slice(expected_payload_size).map(&:join)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,129 @@
1
+ # encoding: binary
2
+
3
+ require File.expand_path('../../../spec_helper', __FILE__)
4
+
5
+
6
+ module AMQ
7
+ module Protocol
8
+ class Queue
9
+ describe Declare do
10
+ describe '.encode' do
11
+ it 'encodes the parameters into a MethodFrame' do
12
+ channel = 1
13
+ queue = 'hello.world'
14
+ passive = false
15
+ durable = true
16
+ exclusive = true
17
+ auto_delete = true
18
+ nowait = false
19
+ arguments = nil
20
+ method_frame = Declare.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
21
+ method_frame.payload.should == "\x002\x00\n\x00\x00\vhello.world\x0E\x00\x00\x00\x00"
22
+ method_frame.channel.should == 1
23
+ end
24
+ end
25
+ end
26
+
27
+ describe DeclareOk do
28
+ describe '.decode' do
29
+ subject do
30
+ DeclareOk.decode(" amq.gen-KduGSqQrpeUo1otnU0TWSA==\x00\x00\x00\x00\x00\x00\x00\x00")
31
+ end
32
+
33
+ its(:queue) { should == 'amq.gen-KduGSqQrpeUo1otnU0TWSA==' }
34
+ its(:message_count) { should == 0 }
35
+ its(:consumer_count) { should == 0 }
36
+ end
37
+ end
38
+
39
+ describe Bind do
40
+ describe '.encode' do
41
+ it 'encodes the parameters into a MethodFrame' do
42
+ channel = 1
43
+ queue = 'hello.world'
44
+ exchange = 'foo.bar'
45
+ routing_key = 'xyz'
46
+ nowait = false
47
+ arguments = nil
48
+ method_frame = Bind.encode(channel, queue, exchange, routing_key, nowait, arguments)
49
+ method_frame.payload.should == "\x002\x00\x14\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00\x00"
50
+ method_frame.channel.should == 1
51
+ end
52
+ end
53
+ end
54
+
55
+ # describe BindOk do
56
+ # describe '.decode' do
57
+ # end
58
+ # end
59
+
60
+ describe Purge do
61
+ describe '.encode' do
62
+ it 'encodes the parameters into a MethodFrame' do
63
+ channel = 1
64
+ queue = 'hello.world'
65
+ nowait = false
66
+ method_frame = Purge.encode(channel, queue, nowait)
67
+ method_frame.payload.should == "\x002\x00\x1E\x00\x00\vhello.world\x00"
68
+ method_frame.channel.should == 1
69
+ end
70
+ end
71
+ end
72
+
73
+ describe PurgeOk do
74
+ describe '.decode' do
75
+ subject do
76
+ PurgeOk.decode("\x00\x00\x00\x02")
77
+ end
78
+
79
+ its(:message_count) { should == 2 }
80
+ end
81
+ end
82
+
83
+ describe Delete do
84
+ describe '.encode' do
85
+ it 'encodes the parameters into a MethodFrame' do
86
+ channel = 1
87
+ queue = 'hello.world'
88
+ if_unused = false
89
+ if_empty = false
90
+ nowait = false
91
+ method_frame = Delete.encode(channel, queue, if_unused, if_empty, nowait)
92
+ method_frame.payload.should == "\x002\x00(\x00\x00\vhello.world\x00"
93
+ method_frame.channel.should == 1
94
+ end
95
+ end
96
+ end
97
+
98
+ describe DeleteOk do
99
+ describe '.decode' do
100
+ subject do
101
+ DeleteOk.decode("\x00\x00\x00\x02")
102
+ end
103
+
104
+ its(:message_count) { should == 2 }
105
+ end
106
+ end
107
+
108
+ describe Unbind do
109
+ describe '.encode' do
110
+ it 'encodes the parameters into a MethodFrame' do
111
+ channel = 1
112
+ queue = 'hello.world'
113
+ exchange = 'foo.bar'
114
+ routing_key = 'xyz'
115
+ arguments = nil
116
+ method_frame = Unbind.encode(channel, queue, exchange, routing_key, arguments)
117
+ method_frame.payload.should == "\x002\x002\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00"
118
+ method_frame.channel.should == 1
119
+ end
120
+ end
121
+ end
122
+
123
+ # describe UnbindOk do
124
+ # describe '.decode' do
125
+ # end
126
+ # end
127
+ end
128
+ end
129
+ end
@@ -1,46 +1,69 @@
1
- # encoding: utf-8
1
+ # encoding: binary
2
2
 
3
- require_relative "../../spec_helper.rb"
3
+ require File.expand_path('../../../spec_helper', __FILE__)
4
+ require 'bigdecimal'
4
5
 
5
- describe AMQ::Protocol::Table do
6
- DATA = {
7
- Hash.new => "\x00\x00\x00\x00",
8
- {"test" => 1} => "\x00\x00\x00\n\x04testI\x00\x00\x00\x01",
9
- {"test" => "string"} => "\x00\x00\x00\x10\x04testS\x00\x00\x00\x06string",
10
- {"test" => Hash.new} => "\x00\x00\x00\n\x04testF\x00\x00\x00\x00",
11
- }
12
6
 
13
- describe ".encode" do
14
- it "should return \"\x00\x00\x00\x00\" for nil" do
15
- Table.encode(nil).should eql("\x00\x00\x00\x00")
16
- end
7
+ module AMQ
8
+ module Protocol
9
+ describe Table do
10
+ timestamp = Time.utc(2010, 12, 31, 23, 58, 59)
11
+ bigdecimal_1 = BigDecimal.new("1.0")
12
+ bigdecimal_2 = BigDecimal.new("5E-3")
13
+ bigdecimal_3 = BigDecimal.new("-0.01")
17
14
 
18
- it "should return \"\x00\x00\x00\n\x04testI\x00\x00\x00\x01\" for {test: true}" do
19
- Table.encode(test: true).should eql("\x00\x00\x00\n\x04testI\x00\x00\x00\x01")
20
- end
21
15
 
22
- DATA.each do |data, encoded|
23
- it "should return #{encoded.inspect} for #{data.inspect}" do
24
- Table.encode(data).should eql(encoded)
16
+ DATA = if one_point_eight?
17
+ {
18
+ {} => "\000\000\000\000",
19
+ {"test" => 1} => "\000\000\000\n\004testI\000\000\000\001",
20
+ {"test" => "string"} => "\000\000\000\020\004testS\000\000\000\006string",
21
+ {"test" => {}} => "\000\000\000\n\004testF\000\000\000\000",
22
+ {"test" => bigdecimal_1} => "\000\000\000\v\004testD\000\000\000\000\001",
23
+ {"test" => bigdecimal_2} => "\000\000\000\v\004testD\003\000\000\000\005",
24
+ {"test" => timestamp} => "\000\000\000\016\004testT\000\000\000\000M\036nC"
25
+ }
26
+ else
27
+ {
28
+ {} => "\x00\x00\x00\x00",
29
+ {"test" => 1} => "\x00\x00\x00\n\x04testI\x00\x00\x00\x01",
30
+ {"test" => "string"} => "\x00\x00\x00\x10\x04testS\x00\x00\x00\x06string",
31
+ {"test" => {}} => "\x00\x00\x00\n\x04testF\x00\x00\x00\x00",
32
+ {"test" => bigdecimal_1} => "\x00\x00\x00\v\x04testD\x00\x00\x00\x00\x01",
33
+ {"test" => bigdecimal_2} => "\x00\x00\x00\v\x04testD\x03\x00\x00\x00\x05",
34
+ {"test" => timestamp} => "\x00\x00\x00\x0e\x04testT\x00\x00\x00\x00M\x1enC"
35
+ }
36
+ end
37
+
38
+ describe ".encode" do
39
+ it "should return \"\x00\x00\x00\x00\" for nil" do
40
+ encoded_value = if one_point_eight?
41
+ "\000\000\000\000"
42
+ else
43
+ "\x00\x00\x00\x00"
44
+ end
45
+
46
+ Table.encode(nil).should eql(encoded_value)
47
+ end
48
+
49
+ it "should return \"\x00\x00\x00\n\x04testI\x00\x00\x00\x01\" for {test: true}" do
50
+ Table.encode(:test => true).should eql("\x00\x00\x00\n\x04testI\x00\x00\x00\x01")
51
+ end
52
+
53
+ DATA.each do |data, encoded|
54
+ it "should return #{encoded.inspect} for #{data.inspect}" do
55
+ Table.encode(data).should eql(encoded)
56
+ end
57
+ end
25
58
  end
26
- end
27
- end
28
59
 
29
- describe ".decode" do
30
- DATA.each do |data, encoded|
31
- it "should return #{data.inspect} for #{encoded.inspect}" do
32
- Table.decode(encoded).should eql(data)
60
+ describe ".decode" do
61
+ DATA.each do |data, encoded|
62
+ it "should return #{data.inspect} for #{encoded.inspect}" do
63
+ Table.decode(encoded).should eql(data)
64
+ end
65
+ end
33
66
  end
34
67
  end
35
68
  end
36
- end
37
-
38
- __END__
39
- # encode({"a":decimal.Decimal("1.0")})
40
- # "\x00\x00\x00\x07\x01aD\x00\x00\x00\x00\x01"
41
- #
42
- # encode({"a":decimal.Decimal("5E-3")})
43
- # "\x00\x00\x00\x07\x01aD\x03\x00\x00\x00\x05"
44
- #
45
- # encode({"a":datetime.datetime(2010,12,31,23,58,59)})
46
- # "\x00\x00\x00\x0b\x01aT\x00\x00\x00\x00M\x1enC"
69
+ end
@@ -0,0 +1,58 @@
1
+ # encoding: binary
2
+
3
+ require File.expand_path('../../../spec_helper', __FILE__)
4
+
5
+
6
+ module AMQ
7
+ module Protocol
8
+ class Tx
9
+ describe Select do
10
+ describe '.encode' do
11
+ it 'encodes the parameters into a MethodFrame' do
12
+ channel = 1
13
+ method_frame = Select.encode(channel)
14
+ method_frame.payload.should == "\000Z\000\n"
15
+ method_frame.channel.should == 1
16
+ end
17
+ end
18
+ end
19
+
20
+ # describe SelectOk do
21
+ # describe '.decode' do
22
+ # end
23
+ # end
24
+
25
+ describe Commit do
26
+ describe '.encode' do
27
+ it 'encodes the parameters into a MethodFrame' do
28
+ channel = 1
29
+ method_frame = Commit.encode(channel)
30
+ method_frame.payload.should == "\000Z\000\024"
31
+ method_frame.channel.should == 1
32
+ end
33
+ end
34
+ end
35
+
36
+ # describe CommitOk do
37
+ # describe '.decode' do
38
+ # end
39
+ # end
40
+
41
+ describe Rollback do
42
+ describe '.encode' do
43
+ it 'encodes the parameters into a MethodFrame' do
44
+ channel = 1
45
+ method_frame = Rollback.encode(channel)
46
+ method_frame.payload.should == "\000Z\000\036"
47
+ method_frame.channel.should == 1
48
+ end
49
+ end
50
+ end
51
+
52
+ # describe RollbackOk do
53
+ # describe '.decode' do
54
+ # end
55
+ # end
56
+ end
57
+ end
58
+ end
@@ -1,888 +1,817 @@
1
- # encoding: utf-8
1
+ # encoding: binary
2
2
 
3
- require_relative "../spec_helper.rb"
3
+ require File.expand_path('../../spec_helper', __FILE__)
4
4
 
5
- describe AMQ::Protocol do
6
- it "should have PROTOCOL_VERSION constant" do
7
- AMQ::Protocol::PROTOCOL_VERSION.should match(/^\d+\.\d+\.\d$/)
8
- end
9
-
10
- it "should have DEFAULT_PORT constant" do
11
- AMQ::Protocol::DEFAULT_PORT.should be_kind_of(Integer)
12
- end
13
5
 
14
- it "should have PREAMBLE constant" do
15
- AMQ::Protocol::PREAMBLE.should be_kind_of(String)
16
- end
17
-
18
- describe ".classes" do
19
- it "should include all the AMQP classes" do
20
- AMQ::Protocol.classes.should include(Queue)
6
+ module AMQ
7
+ describe Protocol do
8
+ it "should have PROTOCOL_VERSION constant" do
9
+ Protocol::PROTOCOL_VERSION.should match(/^\d+\.\d+\.\d$/)
21
10
  end
22
- end
23
11
 
24
- describe ".methods" do
25
- it "should include all the AMQP methods" do
26
- AMQ::Protocol.methods.should include(Queue::DeclareOk)
12
+ it "should have DEFAULT_PORT constant" do
13
+ Protocol::DEFAULT_PORT.should be_kind_of(Integer)
27
14
  end
28
- end
29
15
 
30
- describe AMQ::Protocol::Error do
31
- it "should be an exception class" do
32
- AMQ::Protocol::Error.should < Exception
16
+ it "should have PREAMBLE constant" do
17
+ Protocol::PREAMBLE.should be_kind_of(String)
33
18
  end
34
- end
35
19
 
36
- describe AMQ::Protocol::Connection do
37
- it "should be a subclass of Class" do
38
- Connection.should < Class
39
- end
40
-
41
- it "should have name equal to connection" do
42
- Connection.name.should eql("connection")
43
- end
44
-
45
- it "should have method equal to TODO" do
46
- pending
47
- Connection.method.should eql("TODO")
48
- end
49
-
50
- describe AMQ::Protocol::Connection::Start do
51
- it "should be a subclass of Method" do
52
- Connection::Start.should < Method
20
+ describe Protocol::Error do
21
+ it "should be an exception class" do
22
+ Protocol::Error.should < Exception
53
23
  end
24
+ end
54
25
 
55
- it "should have method name equal to connection.start" do
56
- Connection::Start.name.should eql("connection.start")
26
+ describe Protocol::Connection do
27
+ it "should be a subclass of Class" do
28
+ Protocol::Connection.superclass.should == Protocol::Class
57
29
  end
58
30
 
59
- it "should have method equal to TODO" do
60
- pending
61
- Connection::Start.method.should eql("TODO")
31
+ it "should have name equal to connection" do
32
+ Protocol::Connection.name.should eql("connection")
62
33
  end
63
- end
64
34
 
65
- describe AMQ::Protocol::Connection::StartOk do
66
- it "should be a subclass of Method" do
67
- Connection::StartOk.should < Method
35
+ it "should have method id equal to 10" do
36
+ Protocol::Connection.method_id.should == 10
68
37
  end
69
38
 
70
- it "should have method name equal to connection.start-ok" do
71
- Connection::StartOk.name.should eql("connection.start-ok")
72
- end
39
+ describe Protocol::Connection::Start do
40
+ it "should be a subclass of Method" do
41
+ Protocol::Connection::Start.superclass.should == Protocol::Method
42
+ end
73
43
 
74
- it "should have method equal to TODO" do
75
- pending
76
- Connection::StartOk.method.should eql("TODO")
77
- end
44
+ it "should have method name equal to connection.start" do
45
+ Protocol::Connection::Start.name.should eql("connection.start")
46
+ end
78
47
 
79
- describe ".encode" do
80
- it do
81
- result = Connection::StartOk.encode({client: "AMQ Protocol"}, "PLAIN", "LOGINSguesPASSWORDSguest", "en_GB")
82
- result.should eql("\x00\n\x00\v\x00\x00\x00\x18\x06clientS\x00\x00\x00\fAMQ Protocol\x05PLAIN\x00\x00\x00\x18LOGINSguesPASSWORDSguest\x05en_GB")
48
+ it "should have method id equal to 10" do
49
+ Protocol::Connection::Start.method_id.should == 10
83
50
  end
84
51
  end
85
- end
86
52
 
87
- describe AMQ::Protocol::Connection::Secure do
88
- it "should be a subclass of Method" do
89
- Connection::Secure.should < Method
90
- end
53
+ describe Protocol::Connection::StartOk do
54
+ it "should be a subclass of Method" do
55
+ Protocol::Connection::StartOk.superclass.should == Protocol::Method
56
+ end
91
57
 
92
- it "should have method name equal to connection.secure" do
93
- Connection::Secure.name.should eql("connection.secure")
94
- end
58
+ it "should have method name equal to connection.start-ok" do
59
+ Protocol::Connection::StartOk.name.should eql("connection.start-ok")
60
+ end
95
61
 
96
- it "should have method equal to TODO" do
97
- pending
98
- Connection::Secure.method.should eql("TODO")
62
+ it "has method id equal to 11" do
63
+ Protocol::Connection::StartOk.method_id.should == 11
64
+ end
99
65
  end
100
- end
101
66
 
102
- describe AMQ::Protocol::Connection::SecureOk do
103
- it "should be a subclass of Method" do
104
- Connection::SecureOk.should < Method
105
- end
67
+ describe Protocol::Connection::Secure do
68
+ it "should be a subclass of Method" do
69
+ Protocol::Connection::Secure.superclass.should == Protocol::Method
70
+ end
106
71
 
107
- it "should have method name equal to connection.secure-ok" do
108
- Connection::SecureOk.name.should eql("connection.secure-ok")
109
- end
72
+ it "should have method name equal to connection.secure" do
73
+ Protocol::Connection::Secure.name.should eql("connection.secure")
74
+ end
110
75
 
111
- it "should have method equal to TODO" do
112
- pending
113
- Connection::SecureOk.method.should eql("TODO")
76
+ it "has method id equal to 20" do
77
+ Protocol::Connection::Secure.method_id.should == 20
78
+ end
114
79
  end
115
- end
116
80
 
117
- describe AMQ::Protocol::Connection::Tune do
118
- it "should be a subclass of Method" do
119
- Connection::Tune.should < Method
120
- end
81
+ describe Protocol::Connection::SecureOk do
82
+ it "should be a subclass of Method" do
83
+ Protocol::Connection::SecureOk.superclass.should == Protocol::Method
84
+ end
121
85
 
122
- it "should have method name equal to connection.tune" do
123
- Connection::Tune.name.should eql("connection.tune")
124
- end
86
+ it "should have method name equal to connection.secure-ok" do
87
+ Protocol::Connection::SecureOk.name.should eql("connection.secure-ok")
88
+ end
125
89
 
126
- it "should have method equal to TODO" do
127
- pending
128
- Connection::Tune.method.should eql("TODO")
90
+ it "has method id equal to 21" do
91
+ Protocol::Connection::SecureOk.method_id.should == 21
92
+ end
129
93
  end
130
- end
131
94
 
132
- describe AMQ::Protocol::Connection::TuneOk do
133
- it "should be a subclass of Method" do
134
- Connection::TuneOk.should < Method
135
- end
95
+ describe Protocol::Connection::Tune do
96
+ it "should be a subclass of Method" do
97
+ Protocol::Connection::Tune.superclass.should == Protocol::Method
98
+ end
136
99
 
137
- it "should have method name equal to connection.tune-ok" do
138
- Connection::TuneOk.name.should eql("connection.tune-ok")
139
- end
100
+ it "should have method name equal to connection.tune" do
101
+ Protocol::Connection::Tune.name.should eql("connection.tune")
102
+ end
140
103
 
141
- it "should have method equal to TODO" do
142
- pending
143
- Connection::TuneOk.method.should eql("TODO")
104
+ it "has method id equal to 30" do
105
+ Protocol::Connection::Tune.method_id.should == 30
106
+ end
144
107
  end
145
108
 
146
- describe ".encode" do
147
- it do
148
- result = Connection::TuneOk.encode(0, 131072, 0)
149
- result.should eql("\x00\n\x00\x1F\x00\x00\x00\x02\x00\x00\x00\x00")
109
+ describe Protocol::Connection::TuneOk do
110
+ it "should be a subclass of Method" do
111
+ Protocol::Connection::TuneOk.superclass.should == Protocol::Method
150
112
  end
151
- end
152
- end
153
113
 
154
- describe AMQ::Protocol::Connection::Open do
155
- it "should be a subclass of Method" do
156
- Connection::Open.should < Method
157
- end
114
+ it "should have method name equal to connection.tune-ok" do
115
+ Protocol::Connection::TuneOk.name.should eql("connection.tune-ok")
116
+ end
158
117
 
159
- it "should have method name equal to connection.open" do
160
- Connection::Open.name.should eql("connection.open")
161
- end
118
+ it "has method id equal to 31" do
119
+ Protocol::Connection::TuneOk.method_id.should == 31
120
+ end
162
121
 
163
- it "should have method equal to TODO" do
164
- pending
165
- Connection::Open.method.should eql("TODO")
122
+ describe ".encode" do
123
+ it do
124
+ frame = Protocol::Connection::TuneOk.encode(0, 131072, 0)
125
+ frame.payload.should eql("\x00\n\x00\x1F\x00\x00\x00\x02\x00\x00\x00\x00")
126
+ end
127
+ end
166
128
  end
167
- end
168
129
 
169
- describe AMQ::Protocol::Connection::OpenOk do
170
- it "should be a subclass of Method" do
171
- Connection::OpenOk.should < Method
172
- end
130
+ describe Protocol::Connection::Open do
131
+ it "should be a subclass of Method" do
132
+ Protocol::Connection::Open.superclass.should == Protocol::Method
133
+ end
173
134
 
174
- it "should have method name equal to connection.open-ok" do
175
- Connection::OpenOk.name.should eql("connection.open-ok")
176
- end
135
+ it "should have method name equal to connection.open" do
136
+ Protocol::Connection::Open.name.should eql("connection.open")
137
+ end
177
138
 
178
- it "should have method equal to TODO" do
179
- pending
180
- Connection::OpenOk.method.should eql("TODO")
139
+ it "has method id equal to 40" do
140
+ Protocol::Connection::Open.method_id.should == 40
141
+ end
181
142
  end
182
- end
183
143
 
184
- describe AMQ::Protocol::Connection::Close do
185
- it "should be a subclass of Method" do
186
- Connection::Close.should < Method
187
- end
144
+ describe Protocol::Connection::OpenOk do
145
+ it "should be a subclass of Method" do
146
+ Protocol::Connection::OpenOk.superclass.should == Protocol::Method
147
+ end
188
148
 
189
- it "should have method name equal to connection.close" do
190
- Connection::Close.name.should eql("connection.close")
191
- end
149
+ it "should have method name equal to connection.open-ok" do
150
+ Protocol::Connection::OpenOk.name.should eql("connection.open-ok")
151
+ end
192
152
 
193
- it "should have method equal to TODO" do
194
- pending
195
- Connection::Close.method.should eql("TODO")
153
+ it "has method id equal to 41" do
154
+ Protocol::Connection::OpenOk.method_id.should == 41
155
+ end
196
156
  end
197
- end
198
157
 
199
- describe AMQ::Protocol::Connection::CloseOk do
200
- it "should be a subclass of Method" do
201
- Connection::CloseOk.should < Method
202
- end
158
+ describe Protocol::Connection::Close do
159
+ it "should be a subclass of Method" do
160
+ Protocol::Connection::Close.superclass.should == Protocol::Method
161
+ end
203
162
 
204
- it "should have method name equal to connection.close-ok" do
205
- Connection::CloseOk.name.should eql("connection.close-ok")
206
- end
163
+ it "should have method name equal to connection.close" do
164
+ Protocol::Connection::Close.name.should eql("connection.close")
165
+ end
207
166
 
208
- it "should have method equal to TODO" do
209
- pending
210
- Connection::CloseOk.method.should eql("TODO")
167
+ it "has method id equal to 50" do
168
+ Protocol::Connection::Close.method_id.should == 50
169
+ end
211
170
  end
212
- end
213
- end
214
171
 
215
- describe AMQ::Protocol::Channel do
216
- it "should be a subclass of Class" do
217
- Channel.should < Class
218
- end
172
+ describe Protocol::Connection::CloseOk do
173
+ it "should be a subclass of Method" do
174
+ Protocol::Connection::CloseOk.superclass.should == Protocol::Method
175
+ end
219
176
 
220
- it "should have name equal to channel" do
221
- Channel.name.should eql("channel")
222
- end
177
+ it "should have method name equal to connection.close-ok" do
178
+ Protocol::Connection::CloseOk.name.should eql("connection.close-ok")
179
+ end
223
180
 
224
- it "should have method equal to TODO" do
225
- pending
226
- Channel.method.should eql("TODO")
181
+ it "has method id equal to 51" do
182
+ Protocol::Connection::CloseOk.method_id.should == 51
183
+ end
184
+ end
227
185
  end
228
186
 
229
- describe AMQ::Protocol::Channel::Open do
230
- it "should be a subclass of Method" do
231
- Channel::Open.should < Method
187
+ describe Protocol::Channel do
188
+ it "should be a subclass of Class" do
189
+ Protocol::Channel.superclass.should == Protocol::Class
232
190
  end
233
191
 
234
- it "should have method name equal to channel.open" do
235
- Channel::Open.name.should eql("channel.open")
192
+ it "should have name equal to channel" do
193
+ Protocol::Channel.name.should eql("channel")
236
194
  end
237
195
 
238
- it "should have method equal to TODO" do
239
- pending
240
- Channel::Open.method.should eql("TODO")
196
+ it "has method id equal to 20" do
197
+ Protocol::Channel.method_id.should == 20
241
198
  end
242
- end
243
199
 
244
- describe AMQ::Protocol::Channel::OpenOk do
245
- it "should be a subclass of Method" do
246
- Channel::OpenOk.should < Method
247
- end
200
+ describe Protocol::Channel::Open do
201
+ it "should be a subclass of Method" do
202
+ Protocol::Channel::Open.superclass.should == Protocol::Method
203
+ end
248
204
 
249
- it "should have method name equal to channel.open-ok" do
250
- Channel::OpenOk.name.should eql("channel.open-ok")
251
- end
205
+ it "should have method name equal to channel.open" do
206
+ Protocol::Channel::Open.name.should eql("channel.open")
207
+ end
252
208
 
253
- it "should have method equal to TODO" do
254
- pending
255
- Channel::OpenOk.method.should eql("TODO")
209
+ it "has method id equal to 10" do
210
+ Protocol::Channel::Open.method_id.should == 10
211
+ end
256
212
  end
257
- end
258
213
 
259
- describe AMQ::Protocol::Channel::Flow do
260
- it "should be a subclass of Method" do
261
- Channel::Flow.should < Method
262
- end
214
+ describe Protocol::Channel::OpenOk do
215
+ it "should be a subclass of Method" do
216
+ Protocol::Channel::OpenOk.superclass.should == Protocol::Method
217
+ end
263
218
 
264
- it "should have method name equal to channel.flow" do
265
- Channel::Flow.name.should eql("channel.flow")
266
- end
219
+ it "should have method name equal to channel.open-ok" do
220
+ Protocol::Channel::OpenOk.name.should eql("channel.open-ok")
221
+ end
267
222
 
268
- it "should have method equal to TODO" do
269
- pending
270
- Channel::Flow.method.should eql("TODO")
223
+ it "has method id equal to 11" do
224
+ Protocol::Channel::OpenOk.method_id.should == 11
225
+ end
271
226
  end
272
- end
273
227
 
274
- describe AMQ::Protocol::Channel::FlowOk do
275
- it "should be a subclass of Method" do
276
- Channel::FlowOk.should < Method
277
- end
228
+ describe Protocol::Channel::Flow do
229
+ it "should be a subclass of Method" do
230
+ Protocol::Channel::Flow.superclass.should == Protocol::Method
231
+ end
278
232
 
279
- it "should have method name equal to channel.flow-ok" do
280
- Channel::FlowOk.name.should eql("channel.flow-ok")
281
- end
233
+ it "should have method name equal to channel.flow" do
234
+ Protocol::Channel::Flow.name.should eql("channel.flow")
235
+ end
282
236
 
283
- it "should have method equal to TODO" do
284
- pending
285
- Channel::FlowOk.method.should eql("TODO")
237
+ it "has method id equal to 20" do
238
+ Protocol::Channel::Flow.method_id.should == 20
239
+ end
286
240
  end
287
- end
288
241
 
289
- describe AMQ::Protocol::Channel::Close do
290
- it "should be a subclass of Method" do
291
- Channel::Close.should < Method
292
- end
242
+ describe Protocol::Channel::FlowOk do
243
+ it "should be a subclass of Method" do
244
+ Protocol::Channel::FlowOk.superclass.should == Protocol::Method
245
+ end
293
246
 
294
- it "should have method name equal to channel.close" do
295
- Channel::Close.name.should eql("channel.close")
296
- end
247
+ it "should have method name equal to channel.flow-ok" do
248
+ Protocol::Channel::FlowOk.name.should eql("channel.flow-ok")
249
+ end
297
250
 
298
- it "should have method equal to TODO" do
299
- pending
300
- Channel::Close.method.should eql("TODO")
251
+ it "has method id equal to 21" do
252
+ Protocol::Channel::FlowOk.method_id.should == 21
253
+ end
301
254
  end
302
- end
303
255
 
304
- describe AMQ::Protocol::Channel::CloseOk do
305
- it "should be a subclass of Method" do
306
- Channel::CloseOk.should < Method
307
- end
256
+ describe Protocol::Channel::Close do
257
+ it "should be a subclass of Method" do
258
+ Protocol::Channel::Close.superclass.should == Protocol::Method
259
+ end
308
260
 
309
- it "should have method name equal to channel.close-ok" do
310
- Channel::CloseOk.name.should eql("channel.close-ok")
311
- end
261
+ it "should have method name equal to channel.close" do
262
+ Protocol::Channel::Close.name.should eql("channel.close")
263
+ end
312
264
 
313
- it "should have method equal to TODO" do
314
- pending
315
- Channel::CloseOk.method.should eql("TODO")
265
+ it "has method id equal to 40" do
266
+ Protocol::Channel::Close.method_id.should == 40
267
+ end
316
268
  end
317
- end
318
- end
319
269
 
320
- describe AMQ::Protocol::Exchange do
321
- it "should be a subclass of Class" do
322
- Exchange.should < Class
323
- end
270
+ describe Protocol::Channel::CloseOk do
271
+ it "should be a subclass of Method" do
272
+ Protocol::Channel::CloseOk.superclass.should == Protocol::Method
273
+ end
324
274
 
325
- it "should have name equal to exchange" do
326
- Exchange.name.should eql("exchange")
327
- end
275
+ it "should have method name equal to channel.close-ok" do
276
+ Protocol::Channel::CloseOk.name.should eql("channel.close-ok")
277
+ end
328
278
 
329
- it "should have method equal to TODO" do
330
- pending
331
- Exchange.method.should eql("TODO")
279
+ it "has method id equal to 41" do
280
+ Protocol::Channel::CloseOk.method_id.should == 41
281
+ end
282
+ end
332
283
  end
333
284
 
334
- describe AMQ::Protocol::Exchange::Declare do
335
- it "should be a subclass of Method" do
336
- Exchange::Declare.should < Method
285
+ describe Protocol::Exchange do
286
+ it "should be a subclass of Class" do
287
+ Protocol::Exchange.superclass.should == Protocol::Class
337
288
  end
338
289
 
339
- it "should have method name equal to exchange.declare" do
340
- Exchange::Declare.name.should eql("exchange.declare")
290
+ it "should have name equal to exchange" do
291
+ Protocol::Exchange.name.should eql("exchange")
341
292
  end
342
293
 
343
- it "should have method equal to TODO" do
344
- pending
345
- Exchange::Declare.method.should eql("TODO")
294
+ it "has method id equal to 40" do
295
+ Protocol::Exchange.method_id.should == 40
346
296
  end
347
- end
348
297
 
349
- describe AMQ::Protocol::Exchange::DeclareOk do
350
- it "should be a subclass of Method" do
351
- Exchange::DeclareOk.should < Method
352
- end
298
+ describe Protocol::Exchange::Declare do
299
+ it "should be a subclass of Method" do
300
+ Protocol::Exchange::Declare.superclass.should == Protocol::Method
301
+ end
353
302
 
354
- it "should have method name equal to exchange.declare-ok" do
355
- Exchange::DeclareOk.name.should eql("exchange.declare-ok")
356
- end
303
+ it "should have method name equal to exchange.declare" do
304
+ Protocol::Exchange::Declare.name.should eql("exchange.declare")
305
+ end
357
306
 
358
- it "should have method equal to TODO" do
359
- pending
360
- Exchange::DeclareOk.method.should eql("TODO")
307
+ it "has method id equal to 10" do
308
+ Protocol::Exchange::Declare.method_id.should == 10
309
+ end
361
310
  end
362
- end
363
311
 
364
- describe AMQ::Protocol::Exchange::Delete do
365
- it "should be a subclass of Method" do
366
- Exchange::Delete.should < Method
367
- end
312
+ describe Protocol::Exchange::DeclareOk do
313
+ it "should be a subclass of Method" do
314
+ Protocol::Exchange::DeclareOk.superclass.should == Protocol::Method
315
+ end
368
316
 
369
- it "should have method name equal to exchange.delete" do
370
- Exchange::Delete.name.should eql("exchange.delete")
371
- end
317
+ it "should have method name equal to exchange.declare-ok" do
318
+ Protocol::Exchange::DeclareOk.name.should eql("exchange.declare-ok")
319
+ end
372
320
 
373
- it "should have method equal to TODO" do
374
- pending
375
- Exchange::Delete.method.should eql("TODO")
321
+ it "has method id equal to 11" do
322
+ Protocol::Exchange::DeclareOk.method_id.should == 11
323
+ end
376
324
  end
377
- end
378
325
 
379
- describe AMQ::Protocol::Exchange::DeleteOk do
380
- it "should be a subclass of Method" do
381
- Exchange::DeleteOk.should < Method
382
- end
326
+ describe Protocol::Exchange::Delete do
327
+ it "should be a subclass of Method" do
328
+ Protocol::Exchange::Delete.superclass.should == Protocol::Method
329
+ end
383
330
 
384
- it "should have method name equal to exchange.delete-ok" do
385
- Exchange::DeleteOk.name.should eql("exchange.delete-ok")
386
- end
331
+ it "should have method name equal to exchange.delete" do
332
+ Protocol::Exchange::Delete.name.should eql("exchange.delete")
333
+ end
387
334
 
388
- it "should have method equal to TODO" do
389
- pending
390
- Exchange::DeleteOk.method.should eql("TODO")
335
+ it "has method id equal to 20" do
336
+ Protocol::Exchange::Delete.method_id.should == 20
337
+ end
391
338
  end
392
- end
393
339
 
394
- describe AMQ::Protocol::Exchange::Bind do
395
- it "should be a subclass of Method" do
396
- Exchange::Bind.should < Method
397
- end
340
+ describe Protocol::Exchange::DeleteOk do
341
+ it "should be a subclass of Method" do
342
+ Protocol::Exchange::DeleteOk.superclass.should == Protocol::Method
343
+ end
398
344
 
399
- it "should have method name equal to exchange.bind" do
400
- Exchange::Bind.name.should eql("exchange.bind")
401
- end
345
+ it "should have method name equal to exchange.delete-ok" do
346
+ Protocol::Exchange::DeleteOk.name.should eql("exchange.delete-ok")
347
+ end
402
348
 
403
- it "should have method equal to TODO" do
404
- pending
405
- Exchange::Bind.method.should eql("TODO")
349
+ it "has method id equal to 21" do
350
+ Protocol::Exchange::DeleteOk.method_id.should == 21
351
+ end
406
352
  end
407
- end
408
353
 
409
- describe AMQ::Protocol::Exchange::BindOk do
410
- it "should be a subclass of Method" do
411
- Exchange::BindOk.should < Method
412
- end
354
+ describe Protocol::Exchange::Bind do
355
+ it "should be a subclass of Method" do
356
+ Protocol::Exchange::Bind.superclass.should == Protocol::Method
357
+ end
413
358
 
414
- it "should have method name equal to exchange.bind-ok" do
415
- Exchange::BindOk.name.should eql("exchange.bind-ok")
416
- end
359
+ it "should have method name equal to exchange.bind" do
360
+ Protocol::Exchange::Bind.name.should eql("exchange.bind")
361
+ end
417
362
 
418
- it "should have method equal to TODO" do
419
- pending
420
- Exchange::BindOk.method.should eql("TODO")
363
+ it "has method id equal to 30" do
364
+ Protocol::Exchange::Bind.method_id.should == 30
365
+ end
421
366
  end
422
- end
423
367
 
424
- describe AMQ::Protocol::Exchange::Unbind do
425
- it "should be a subclass of Method" do
426
- Exchange::Unbind.should < Method
427
- end
368
+ describe Protocol::Exchange::BindOk do
369
+ it "should be a subclass of Method" do
370
+ Protocol::Exchange::BindOk.superclass.should == Protocol::Method
371
+ end
428
372
 
429
- it "should have method name equal to exchange.unbind" do
430
- Exchange::Unbind.name.should eql("exchange.unbind")
431
- end
373
+ it "should have method name equal to exchange.bind-ok" do
374
+ Protocol::Exchange::BindOk.name.should eql("exchange.bind-ok")
375
+ end
432
376
 
433
- it "should have method equal to TODO" do
434
- pending
435
- Exchange::Unbind.method.should eql("TODO")
377
+ it "has method id equal to 31" do
378
+ Protocol::Exchange::BindOk.method_id.should == 31
379
+ end
436
380
  end
437
- end
438
381
 
439
- describe AMQ::Protocol::Exchange::UnbindOk do
440
- it "should be a subclass of Method" do
441
- Exchange::UnbindOk.should < Method
442
- end
382
+ describe Protocol::Exchange::Unbind do
383
+ it "should be a subclass of Method" do
384
+ Protocol::Exchange::Unbind.superclass.should == Protocol::Method
385
+ end
443
386
 
444
- it "should have method name equal to exchange.unbind-ok" do
445
- Exchange::UnbindOk.name.should eql("exchange.unbind-ok")
446
- end
387
+ it "should have method name equal to exchange.unbind" do
388
+ Protocol::Exchange::Unbind.name.should eql("exchange.unbind")
389
+ end
447
390
 
448
- it "should have method equal to TODO" do
449
- pending
450
- Exchange::UnbindOk.method.should eql("TODO")
391
+ it "has method id equal to 40" do
392
+ Protocol::Exchange::Unbind.method_id.should == 40
393
+ end
451
394
  end
452
- end
453
- end
454
395
 
455
- describe AMQ::Protocol::Queue do
456
- it "should be a subclass of Class" do
457
- Queue.should < Class
458
- end
396
+ describe Protocol::Exchange::UnbindOk do
397
+ it "should be a subclass of Method" do
398
+ Protocol::Exchange::UnbindOk.superclass.should == Protocol::Method
399
+ end
459
400
 
460
- it "should have name equal to queue" do
461
- Queue.name.should eql("queue")
462
- end
401
+ it "should have method name equal to exchange.unbind-ok" do
402
+ Protocol::Exchange::UnbindOk.name.should eql("exchange.unbind-ok")
403
+ end
463
404
 
464
- it "should have method equal to TODO" do
465
- pending
466
- Queue.method.should eql("TODO")
405
+ it "has method id equal to 51" do
406
+ Protocol::Exchange::UnbindOk.method_id.should == 51
407
+ end
408
+ end
467
409
  end
468
410
 
469
- describe AMQ::Protocol::Queue::Declare do
470
- it "should be a subclass of Method" do
471
- Queue::Declare.should < Method
411
+ describe Protocol::Queue do
412
+ it "should be a subclass of Class" do
413
+ Protocol::Queue.superclass.should == Protocol::Class
472
414
  end
473
415
 
474
- it "should have method name equal to queue.declare" do
475
- Queue::Declare.name.should eql("queue.declare")
416
+ it "should have name equal to queue" do
417
+ Protocol::Queue.name.should eql("queue")
476
418
  end
477
419
 
478
- it "should have method equal to TODO" do
479
- pending
480
- Queue::Declare.method.should eql("TODO")
420
+ it "has method id equal to 50" do
421
+ Protocol::Queue.method_id.should == 50
481
422
  end
482
- end
483
423
 
484
- describe AMQ::Protocol::Queue::DeclareOk do
485
- it "should be a subclass of Method" do
486
- Queue::DeclareOk.should < Method
487
- end
424
+ describe Protocol::Queue::Declare do
425
+ it "should be a subclass of Method" do
426
+ Protocol::Queue::Declare.superclass.should == Protocol::Method
427
+ end
488
428
 
489
- it "should have method name equal to queue.declare-ok" do
490
- Queue::DeclareOk.name.should eql("queue.declare-ok")
491
- end
429
+ it "should have method name equal to queue.declare" do
430
+ Protocol::Queue::Declare.name.should eql("queue.declare")
431
+ end
492
432
 
493
- it "should have method equal to TODO" do
494
- pending
495
- Queue::DeclareOk.method.should eql("TODO")
433
+ it "has method id equal to 10" do
434
+ Protocol::Queue::Declare.method_id.should == 10
435
+ end
496
436
  end
497
- end
498
437
 
499
- describe AMQ::Protocol::Queue::Bind do
500
- it "should be a subclass of Method" do
501
- Queue::Bind.should < Method
502
- end
438
+ describe Protocol::Queue::DeclareOk do
439
+ it "should be a subclass of Method" do
440
+ Protocol::Queue::DeclareOk.superclass.should == Protocol::Method
441
+ end
503
442
 
504
- it "should have method name equal to queue.bind" do
505
- Queue::Bind.name.should eql("queue.bind")
506
- end
443
+ it "should have method name equal to queue.declare-ok" do
444
+ Protocol::Queue::DeclareOk.name.should eql("queue.declare-ok")
445
+ end
507
446
 
508
- it "should have method equal to TODO" do
509
- pending
510
- Queue::Bind.method.should eql("TODO")
447
+ it "has method id equal to 11" do
448
+ Protocol::Queue::DeclareOk.method_id.should == 11
449
+ end
511
450
  end
512
- end
513
451
 
514
- describe AMQ::Protocol::Queue::BindOk do
515
- it "should be a subclass of Method" do
516
- Queue::BindOk.should < Method
517
- end
452
+ describe Protocol::Queue::Bind do
453
+ it "should be a subclass of Method" do
454
+ Protocol::Queue::Bind.superclass.should == Protocol::Method
455
+ end
518
456
 
519
- it "should have method name equal to queue.bind-ok" do
520
- Queue::BindOk.name.should eql("queue.bind-ok")
521
- end
457
+ it "should have method name equal to queue.bind" do
458
+ Protocol::Queue::Bind.name.should eql("queue.bind")
459
+ end
522
460
 
523
- it "should have method equal to TODO" do
524
- pending
525
- Queue::BindOk.method.should eql("TODO")
461
+ it "has method id equal to 20" do
462
+ Protocol::Queue::Bind.method_id.should == 20
463
+ end
526
464
  end
527
- end
528
465
 
529
- describe AMQ::Protocol::Queue::Purge do
530
- it "should be a subclass of Method" do
531
- Queue::Purge.should < Method
532
- end
466
+ describe Protocol::Queue::BindOk do
467
+ it "should be a subclass of Method" do
468
+ Protocol::Queue::BindOk.superclass.should == Protocol::Method
469
+ end
533
470
 
534
- it "should have method name equal to queue.purge" do
535
- Queue::Purge.name.should eql("queue.purge")
536
- end
471
+ it "should have method name equal to queue.bind-ok" do
472
+ Protocol::Queue::BindOk.name.should eql("queue.bind-ok")
473
+ end
537
474
 
538
- it "should have method equal to TODO" do
539
- pending
540
- Queue::Purge.method.should eql("TODO")
475
+ it "has method id equal to 21" do
476
+ Protocol::Queue::BindOk.method_id.should == 21
477
+ end
541
478
  end
542
- end
543
479
 
544
- describe AMQ::Protocol::Queue::PurgeOk do
545
- it "should be a subclass of Method" do
546
- Queue::PurgeOk.should < Method
547
- end
480
+ describe Protocol::Queue::Purge do
481
+ it "should be a subclass of Method" do
482
+ Protocol::Queue::Purge.superclass.should == Protocol::Method
483
+ end
548
484
 
549
- it "should have method name equal to queue.purge-ok" do
550
- Queue::PurgeOk.name.should eql("queue.purge-ok")
551
- end
485
+ it "should have method name equal to queue.purge" do
486
+ Protocol::Queue::Purge.name.should eql("queue.purge")
487
+ end
552
488
 
553
- it "should have method equal to TODO" do
554
- pending
555
- Queue::PurgeOk.method.should eql("TODO")
489
+ it "has method id equal to 30" do
490
+ Protocol::Queue::Purge.method_id.should == 30
491
+ end
556
492
  end
557
- end
558
493
 
559
- describe AMQ::Protocol::Queue::Delete do
560
- it "should be a subclass of Method" do
561
- Queue::Delete.should < Method
562
- end
494
+ describe Protocol::Queue::PurgeOk do
495
+ it "should be a subclass of Method" do
496
+ Protocol::Queue::PurgeOk.superclass.should == Protocol::Method
497
+ end
563
498
 
564
- it "should have method name equal to queue.delete" do
565
- Queue::Delete.name.should eql("queue.delete")
566
- end
499
+ it "should have method name equal to queue.purge-ok" do
500
+ Protocol::Queue::PurgeOk.name.should eql("queue.purge-ok")
501
+ end
567
502
 
568
- it "should have method equal to TODO" do
569
- pending
570
- Queue::Delete.method.should eql("TODO")
503
+ it "has method id equal to 31" do
504
+ Protocol::Queue::PurgeOk.method_id.should == 31
505
+ end
571
506
  end
572
- end
573
507
 
574
- describe AMQ::Protocol::Queue::DeleteOk do
575
- it "should be a subclass of Method" do
576
- Queue::DeleteOk.should < Method
577
- end
508
+ describe Protocol::Queue::Delete do
509
+ it "should be a subclass of Method" do
510
+ Protocol::Queue::Delete.superclass.should == Protocol::Method
511
+ end
578
512
 
579
- it "should have method name equal to queue.delete-ok" do
580
- Queue::DeleteOk.name.should eql("queue.delete-ok")
581
- end
513
+ it "should have method name equal to queue.delete" do
514
+ Protocol::Queue::Delete.name.should eql("queue.delete")
515
+ end
582
516
 
583
- it "should have method equal to TODO" do
584
- pending
585
- Queue::DeleteOk.method.should eql("TODO")
517
+ it "has method id equal to 40" do
518
+ Protocol::Queue::Delete.method_id.should == 40
519
+ end
586
520
  end
587
- end
588
521
 
589
- describe AMQ::Protocol::Queue::Unbind do
590
- it "should be a subclass of Method" do
591
- Queue::Unbind.should < Method
592
- end
522
+ describe Protocol::Queue::DeleteOk do
523
+ it "should be a subclass of Method" do
524
+ Protocol::Queue::DeleteOk.superclass.should == Protocol::Method
525
+ end
593
526
 
594
- it "should have method name equal to queue.unbind" do
595
- Queue::Unbind.name.should eql("queue.unbind")
596
- end
527
+ it "should have method name equal to queue.delete-ok" do
528
+ Protocol::Queue::DeleteOk.name.should eql("queue.delete-ok")
529
+ end
597
530
 
598
- it "should have method equal to TODO" do
599
- pending
600
- Queue::Unbind.method.should eql("TODO")
531
+ it "has method id equal to 41" do
532
+ Protocol::Queue::DeleteOk.method_id.should == 41
533
+ end
601
534
  end
602
- end
603
535
 
604
- describe AMQ::Protocol::Queue::UnbindOk do
605
- it "should be a subclass of Method" do
606
- Queue::UnbindOk.should < Method
607
- end
536
+ describe Protocol::Queue::Unbind do
537
+ it "should be a subclass of Method" do
538
+ Protocol::Queue::Unbind.superclass.should == Protocol::Method
539
+ end
608
540
 
609
- it "should have method name equal to queue.unbind-ok" do
610
- Queue::UnbindOk.name.should eql("queue.unbind-ok")
611
- end
541
+ it "should have method name equal to queue.unbind" do
542
+ Protocol::Queue::Unbind.name.should eql("queue.unbind")
543
+ end
612
544
 
613
- it "should have method equal to TODO" do
614
- pending
615
- Queue::UnbindOk.method.should eql("TODO")
545
+ it "has method id equal to 50" do
546
+ Protocol::Queue::Unbind.method_id.should == 50
547
+ end
616
548
  end
617
- end
618
- end
619
549
 
620
- describe AMQ::Protocol::Basic do
621
- it "should be a subclass of Class" do
622
- Basic.should < Class
623
- end
550
+ describe Protocol::Queue::UnbindOk do
551
+ it "should be a subclass of Method" do
552
+ Protocol::Queue::UnbindOk.superclass.should == Protocol::Method
553
+ end
624
554
 
625
- it "should have name equal to basic" do
626
- Basic.name.should eql("basic")
627
- end
555
+ it "should have method name equal to queue.unbind-ok" do
556
+ Protocol::Queue::UnbindOk.name.should eql("queue.unbind-ok")
557
+ end
628
558
 
629
- it "should have method equal to TODO" do
630
- pending
631
- Basic.method.should eql("TODO")
632
- end
633
- describe AMQ::Protocol::Basic::Qos do
634
- it "should be a subclass of Method" do
635
- Basic::Qos.should < Method
559
+ it "has method id equal to 51" do
560
+ Protocol::Queue::UnbindOk.method_id.should == 51
561
+ end
636
562
  end
563
+ end
637
564
 
638
- it "should have method name equal to basic.qos" do
639
- Basic::Qos.name.should eql("basic.qos")
565
+ describe Protocol::Basic do
566
+ it "should be a subclass of Class" do
567
+ Protocol::Basic.superclass.should == Protocol::Class
640
568
  end
641
569
 
642
- it "should have method equal to TODO" do
643
- pending
644
- Basic::Qos.method.should eql("TODO")
570
+ it "should have name equal to basic" do
571
+ Protocol::Basic.name.should eql("basic")
645
572
  end
646
- end
647
573
 
648
- describe AMQ::Protocol::Basic::QosOk do
649
- it "should be a subclass of Method" do
650
- Basic::QosOk.should < Method
574
+ it "has method id equal to 60" do
575
+ Protocol::Basic.method_id.should == 60
651
576
  end
652
577
 
653
- it "should have method name equal to basic.qos-ok" do
654
- Basic::QosOk.name.should eql("basic.qos-ok")
655
- end
578
+ describe Protocol::Basic::Qos do
579
+ it "should be a subclass of Method" do
580
+ Protocol::Basic::Qos.superclass.should == Protocol::Method
581
+ end
656
582
 
657
- it "should have method equal to TODO" do
658
- pending
659
- Basic::QosOk.method.should eql("TODO")
660
- end
661
- end
583
+ it "should have method name equal to basic.qos" do
584
+ Protocol::Basic::Qos.name.should eql("basic.qos")
585
+ end
662
586
 
663
- describe AMQ::Protocol::Basic::Consume do
664
- it "should be a subclass of Method" do
665
- Basic::Consume.should < Method
587
+ it "has method id equal to 10" do
588
+ Protocol::Basic::Qos.method_id.should == 10
589
+ end
666
590
  end
667
591
 
668
- it "should have method name equal to basic.consume" do
669
- Basic::Consume.name.should eql("basic.consume")
670
- end
592
+ describe Protocol::Basic::QosOk do
593
+ it "should be a subclass of Method" do
594
+ Protocol::Basic::QosOk.superclass.should == Protocol::Method
595
+ end
671
596
 
672
- it "should have method equal to TODO" do
673
- pending
674
- Basic::Consume.method.should eql("TODO")
675
- end
676
- end
597
+ it "should have method name equal to basic.qos-ok" do
598
+ Protocol::Basic::QosOk.name.should eql("basic.qos-ok")
599
+ end
677
600
 
678
- describe AMQ::Protocol::Basic::ConsumeOk do
679
- it "should be a subclass of Method" do
680
- Basic::ConsumeOk.should < Method
601
+ it "has method id equal to 11" do
602
+ Protocol::Basic::QosOk.method_id.should == 11
603
+ end
681
604
  end
682
605
 
683
- it "should have method name equal to basic.consume-ok" do
684
- Basic::ConsumeOk.name.should eql("basic.consume-ok")
685
- end
606
+ describe Protocol::Basic::Consume do
607
+ it "should be a subclass of Method" do
608
+ Protocol::Basic::Consume.superclass.should == Protocol::Method
609
+ end
686
610
 
687
- it "should have method equal to TODO" do
688
- pending
689
- Basic::ConsumeOk.method.should eql("TODO")
690
- end
691
- end
611
+ it "should have method name equal to basic.consume" do
612
+ Protocol::Basic::Consume.name.should eql("basic.consume")
613
+ end
692
614
 
693
- describe AMQ::Protocol::Basic::Cancel do
694
- it "should be a subclass of Method" do
695
- Basic::Cancel.should < Method
615
+ it "has method id equal to 20" do
616
+ Protocol::Basic::Consume.method_id.should == 20
617
+ end
696
618
  end
697
619
 
698
- it "should have method name equal to basic.cancel" do
699
- Basic::Cancel.name.should eql("basic.cancel")
700
- end
620
+ describe Protocol::Basic::ConsumeOk do
621
+ it "should be a subclass of Method" do
622
+ Protocol::Basic::ConsumeOk.superclass.should == Protocol::Method
623
+ end
701
624
 
702
- it "should have method equal to TODO" do
703
- pending
704
- Basic::Cancel.method.should eql("TODO")
705
- end
706
- end
625
+ it "should have method name equal to basic.consume-ok" do
626
+ Protocol::Basic::ConsumeOk.name.should eql("basic.consume-ok")
627
+ end
707
628
 
708
- describe AMQ::Protocol::Basic::CancelOk do
709
- it "should be a subclass of Method" do
710
- Basic::CancelOk.should < Method
629
+ it "has method id equal to 21" do
630
+ Protocol::Basic::ConsumeOk.method_id.should == 21
631
+ end
711
632
  end
712
633
 
713
- it "should have method name equal to basic.cancel-ok" do
714
- Basic::CancelOk.name.should eql("basic.cancel-ok")
715
- end
634
+ describe Protocol::Basic::Cancel do
635
+ it "should be a subclass of Method" do
636
+ Protocol::Basic::Cancel.superclass.should == Protocol::Method
637
+ end
716
638
 
717
- it "should have method equal to TODO" do
718
- pending
719
- Basic::CancelOk.method.should eql("TODO")
720
- end
721
- end
639
+ it "should have method name equal to basic.cancel" do
640
+ Protocol::Basic::Cancel.name.should eql("basic.cancel")
641
+ end
722
642
 
723
- describe AMQ::Protocol::Basic::Publish do
724
- it "should be a subclass of Method" do
725
- Basic::Publish.should < Method
643
+ it "has method id equal to 30" do
644
+ Protocol::Basic::Cancel.method_id.should == 30
645
+ end
726
646
  end
727
647
 
728
- it "should have method name equal to basic.publish" do
729
- Basic::Publish.name.should eql("basic.publish")
730
- end
648
+ describe Protocol::Basic::CancelOk do
649
+ it "should be a subclass of Method" do
650
+ Protocol::Basic::CancelOk.superclass.should == Protocol::Method
651
+ end
731
652
 
732
- it "should have method equal to TODO" do
733
- pending
734
- Basic::Publish.method.should eql("TODO")
735
- end
736
- end
653
+ it "should have method name equal to basic.cancel-ok" do
654
+ Protocol::Basic::CancelOk.name.should eql("basic.cancel-ok")
655
+ end
737
656
 
738
- describe AMQ::Protocol::Basic::Return do
739
- it "should be a subclass of Method" do
740
- Basic::Return.should < Method
657
+ it "has method id equal to 31" do
658
+ Protocol::Basic::CancelOk.method_id.should == 31
659
+ end
741
660
  end
742
661
 
743
- it "should have method name equal to basic.return" do
744
- Basic::Return.name.should eql("basic.return")
745
- end
662
+ describe Protocol::Basic::Publish do
663
+ it "should be a subclass of Method" do
664
+ Protocol::Basic::Publish.superclass.should == Protocol::Method
665
+ end
746
666
 
747
- it "should have method equal to TODO" do
748
- pending
749
- Basic::Return.method.should eql("TODO")
750
- end
751
- end
667
+ it "should have method name equal to basic.publish" do
668
+ Protocol::Basic::Publish.name.should eql("basic.publish")
669
+ end
752
670
 
753
- describe AMQ::Protocol::Basic::Deliver do
754
- it "should be a subclass of Method" do
755
- Basic::Deliver.should < Method
671
+ it "has method id equal to 40" do
672
+ Protocol::Basic::Publish.method_id.should == 40
673
+ end
756
674
  end
757
675
 
758
- it "should have method name equal to basic.deliver" do
759
- Basic::Deliver.name.should eql("basic.deliver")
760
- end
676
+ describe Protocol::Basic::Return do
677
+ it "should be a subclass of Method" do
678
+ Protocol::Basic::Return.superclass.should == Protocol::Method
679
+ end
761
680
 
762
- it "should have method equal to TODO" do
763
- pending
764
- Basic::Deliver.method.should eql("TODO")
765
- end
766
- end
681
+ it "should have method name equal to basic.return" do
682
+ Protocol::Basic::Return.name.should eql("basic.return")
683
+ end
767
684
 
768
- describe AMQ::Protocol::Basic::Get do
769
- it "should be a subclass of Method" do
770
- Basic::Get.should < Method
685
+ it "has method id equal to 50" do
686
+ Protocol::Basic::Return.method_id.should == 50
687
+ end
771
688
  end
772
689
 
773
- it "should have method name equal to basic.get" do
774
- Basic::Get.name.should eql("basic.get")
775
- end
690
+ describe Protocol::Basic::Deliver do
691
+ it "should be a subclass of Method" do
692
+ Protocol::Basic::Deliver.superclass.should == Protocol::Method
693
+ end
776
694
 
777
- it "should have method equal to TODO" do
778
- pending
779
- Basic::Get.method.should eql("TODO")
780
- end
781
- end
695
+ it "should have method name equal to basic.deliver" do
696
+ Protocol::Basic::Deliver.name.should eql("basic.deliver")
697
+ end
782
698
 
783
- describe AMQ::Protocol::Basic::GetOk do
784
- it "should be a subclass of Method" do
785
- Basic::GetOk.should < Method
699
+ it "has method id equal to 60" do
700
+ Protocol::Basic::Deliver.method_id.should == 60
701
+ end
786
702
  end
787
703
 
788
- it "should have method name equal to basic.get-ok" do
789
- Basic::GetOk.name.should eql("basic.get-ok")
790
- end
704
+ describe Protocol::Basic::Get do
705
+ it "should be a subclass of Method" do
706
+ Protocol::Basic::Get.superclass.should == Protocol::Method
707
+ end
791
708
 
792
- it "should have method equal to TODO" do
793
- pending
794
- Basic::GetOk.method.should eql("TODO")
795
- end
796
- end
709
+ it "should have method name equal to basic.get" do
710
+ Protocol::Basic::Get.name.should eql("basic.get")
711
+ end
797
712
 
798
- describe AMQ::Protocol::Basic::GetEmpty do
799
- it "should be a subclass of Method" do
800
- Basic::GetEmpty.should < Method
713
+ it "has method id equal to 70" do
714
+ Protocol::Basic::Get.method_id.should == 70
715
+ end
801
716
  end
802
717
 
803
- it "should have method name equal to basic.get-empty" do
804
- Basic::GetEmpty.name.should eql("basic.get-empty")
805
- end
718
+ describe Protocol::Basic::GetOk do
719
+ it "should be a subclass of Method" do
720
+ Protocol::Basic::GetOk.superclass.should == Protocol::Method
721
+ end
806
722
 
807
- it "should have method equal to TODO" do
808
- pending
809
- Basic::GetEmpty.method.should eql("TODO")
810
- end
811
- end
723
+ it "should have method name equal to basic.get-ok" do
724
+ Protocol::Basic::GetOk.name.should eql("basic.get-ok")
725
+ end
812
726
 
813
- describe AMQ::Protocol::Basic::Ack do
814
- it "should be a subclass of Method" do
815
- Basic::Ack.should < Method
727
+ it "has method id equal to 71" do
728
+ Protocol::Basic::GetOk.method_id.should == 71
729
+ end
816
730
  end
817
731
 
818
- it "should have method name equal to basic.ack" do
819
- Basic::Ack.name.should eql("basic.ack")
820
- end
732
+ describe Protocol::Basic::GetEmpty do
733
+ it "should be a subclass of Method" do
734
+ Protocol::Basic::GetEmpty.superclass.should == Protocol::Method
735
+ end
821
736
 
822
- it "should have method equal to TODO" do
823
- pending
824
- Basic::Ack.method.should eql("TODO")
825
- end
826
- end
737
+ it "should have method name equal to basic.get-empty" do
738
+ Protocol::Basic::GetEmpty.name.should eql("basic.get-empty")
739
+ end
827
740
 
828
- describe AMQ::Protocol::Basic::Reject do
829
- it "should be a subclass of Method" do
830
- Basic::Reject.should < Method
741
+ it "has method id equal to 72" do
742
+ Protocol::Basic::GetEmpty.method_id.should == 72
743
+ end
831
744
  end
832
745
 
833
- it "should have method name equal to basic.reject" do
834
- Basic::Reject.name.should eql("basic.reject")
835
- end
746
+ describe Protocol::Basic::Ack do
747
+ it "should be a subclass of Method" do
748
+ Protocol::Basic::Ack.superclass.should == Protocol::Method
749
+ end
836
750
 
837
- it "should have method equal to TODO" do
838
- pending
839
- Basic::Reject.method.should eql("TODO")
840
- end
841
- end
751
+ it "should have method name equal to basic.ack" do
752
+ Protocol::Basic::Ack.name.should eql("basic.ack")
753
+ end
842
754
 
843
- describe AMQ::Protocol::Basic::RecoverAsync do
844
- it "should be a subclass of Method" do
845
- Basic::RecoverAsync.should < Method
755
+ it "has method id equal to 80" do
756
+ Protocol::Basic::Ack.method_id.should == 80
757
+ end
846
758
  end
847
759
 
848
- it "should have method name equal to basic.recover-async" do
849
- Basic::RecoverAsync.name.should eql("basic.recover-async")
850
- end
760
+ describe Protocol::Basic::Reject do
761
+ it "should be a subclass of Method" do
762
+ Protocol::Basic::Reject.superclass.should == Protocol::Method
763
+ end
851
764
 
852
- it "should have method equal to TODO" do
853
- pending
854
- Basic::RecoverAsync.method.should eql("TODO")
855
- end
856
- end
765
+ it "should have method name equal to basic.reject" do
766
+ Protocol::Basic::Reject.name.should eql("basic.reject")
767
+ end
857
768
 
858
- describe AMQ::Protocol::Basic::Recover do
859
- it "should be a subclass of Method" do
860
- Basic::Recover.should < Method
769
+ it "has method id equal to 90" do
770
+ Protocol::Basic::Reject.method_id.should == 90
771
+ end
861
772
  end
862
773
 
863
- it "should have method name equal to basic.recover" do
864
- Basic::Recover.name.should eql("basic.recover")
865
- end
774
+ describe Protocol::Basic::RecoverAsync do
775
+ it "should be a subclass of Method" do
776
+ Protocol::Basic::RecoverAsync.superclass.should == Protocol::Method
777
+ end
866
778
 
867
- it "should have method equal to TODO" do
868
- pending
869
- Basic::Recover.method.should eql("TODO")
870
- end
871
- end
779
+ it "should have method name equal to basic.recover-async" do
780
+ Protocol::Basic::RecoverAsync.name.should eql("basic.recover-async")
781
+ end
872
782
 
873
- describe AMQ::Protocol::Basic::RecoverOk do
874
- it "should be a subclass of Method" do
875
- Basic::RecoverOk.should < Method
783
+ it "has method id equal to 100" do
784
+ Protocol::Basic::RecoverAsync.method_id.should == 100
785
+ end
876
786
  end
877
787
 
878
- it "should have method name equal to basic.recover-ok" do
879
- Basic::RecoverOk.name.should eql("basic.recover-ok")
788
+ describe Protocol::Basic::Recover do
789
+ it "should be a subclass of Method" do
790
+ Protocol::Basic::Recover.superclass.should == Protocol::Method
791
+ end
792
+
793
+ it "should have method name equal to basic.recover" do
794
+ Protocol::Basic::Recover.name.should eql("basic.recover")
795
+ end
796
+
797
+ it "has method id equal to 110" do
798
+ Protocol::Basic::Recover.method_id.should == 110
799
+ end
880
800
  end
881
801
 
882
- it "should have method equal to TODO" do
883
- pending
884
- Basic::RecoverOk.method.should eql("TODO")
802
+ describe Protocol::Basic::RecoverOk do
803
+ it "should be a subclass of Method" do
804
+ Protocol::Basic::RecoverOk.superclass.should == Protocol::Method
805
+ end
806
+
807
+ it "should have method name equal to basic.recover-ok" do
808
+ Protocol::Basic::RecoverOk.name.should eql("basic.recover-ok")
809
+ end
810
+
811
+ it "has method id equal to 111" do
812
+ Protocol::Basic::RecoverOk.method_id.should == 111
813
+ end
885
814
  end
886
815
  end
887
816
  end
888
- end
817
+ end