amq-protocol 0.0.1.pre

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.
@@ -0,0 +1,82 @@
1
+ # encoding: binary
2
+
3
+ require_relative "../../spec_helper.rb"
4
+ require "stringio"
5
+
6
+ describe AMQ::Protocol::Frame do
7
+ describe ".encode" do
8
+ it "should raise ConnectionError if type isn't one of: [:method, :header, :body, :heartbeat]" do
9
+ -> { Frame.encode(nil, 0, "") }.should raise_error(ConnectionError, "Must be one of [:method, :header, :body, :heartbeat]")
10
+ end
11
+
12
+ it "should raise RuntimeError if channel isn't 0 or an integer in range 1..65535" do
13
+ -> { Frame.encode(:method, -1, "") }.should raise_error(RuntimeError, "Channel has to be 0 or an integer in range 1..65535")
14
+ -> { Frame.encode(:method, 65536, "") }.should raise_error(RuntimeError, "Channel has to be 0 or an integer in range 1..65535")
15
+ -> { Frame.encode(:method, 65535, "") }.should_not raise_error(RuntimeError, "Channel has to be 0 or an integer in range 1..65535")
16
+ -> { Frame.encode(:method, 0, "") }.should_not raise_error(RuntimeError, "Channel has to be 0 or an integer in range 1..65535")
17
+ -> { Frame.encode(:method, 1, "") }.should_not raise_error(RuntimeError, "Channel has to be 0 or an integer in range 1..65535")
18
+ end
19
+
20
+ it "should raise RuntimeError if payload is nil" do
21
+ -> { Frame.encode(:method, 0, nil) }.should raise_error(RuntimeError, "Payload can't be nil")
22
+ end
23
+
24
+ it "should encode type" do
25
+ Frame.encode(:body, 0, "").unpack("c").first.should eql(3)
26
+ end
27
+
28
+ it "should encode channel" do
29
+ Frame.encode(:body, 12, "").unpack("cn").last.should eql(12)
30
+ end
31
+
32
+ it "should encode size" do
33
+ Frame.encode(:body, 12, "test").unpack("cnN").last.should eql(4)
34
+ end
35
+
36
+ it "should include payload" do
37
+ Frame.encode(:body, 12, "test")[7..-2].should eql("test")
38
+ end
39
+
40
+ it "should include final octet" do
41
+ Frame.encode(:body, 12, "test")[-1].should eql("\xCE")
42
+ end
43
+ end
44
+
45
+ describe ".new" do
46
+ before(:each) do
47
+ @data = Frame.encode(:body, 5, "test")
48
+ @readable = StringIO.new(@data)
49
+ end
50
+
51
+ it "should decode type" do
52
+ Frame.decode(@readable).type.should eql(:body)
53
+ end
54
+
55
+ it "should decode size" do
56
+ Frame.decode(@readable).size.should eql(4)
57
+ end
58
+
59
+ it "should decode channel" do
60
+ Frame.decode(@readable).channel.should eql(5)
61
+ end
62
+
63
+ it "should decode payload" do
64
+ Frame.decode(@readable).payload.should eql("test")
65
+ end
66
+
67
+ it "should raise RuntimeError if the size is bigger than the actual size" do
68
+ pending
69
+ invalid_data = @data.dup
70
+ invalid_data[3..6] = [5].pack("N")
71
+ readable = StringIO.new(invalid_data)
72
+ -> { Frame.decode(readable) }.should raise_error(RuntimeError, "Frame doesn't end with \xCE as it must, which means the size is miscalculated.")
73
+ end
74
+
75
+ it "should raise RuntimeError if the size is smaller than the actual size" do
76
+ invalid_data = @data.dup
77
+ invalid_data[3..6] = [3].pack("N")
78
+ readable = StringIO.new(invalid_data)
79
+ -> { Frame.decode(readable) }.should raise_error(RuntimeError, "Frame doesn't end with \xCE as it must, which means the size is miscalculated.")
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../../spec_helper.rb"
4
+
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
+
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
17
+
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
+
22
+ DATA.each do |data, encoded|
23
+ it "should return #{encoded.inspect} for #{data.inspect}" do
24
+ Table.encode(data).should eql(encoded)
25
+ end
26
+ end
27
+ end
28
+
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)
33
+ end
34
+ end
35
+ 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"
@@ -0,0 +1,888 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper.rb"
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
+
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)
21
+ end
22
+ end
23
+
24
+ describe ".methods" do
25
+ it "should include all the AMQP methods" do
26
+ AMQ::Protocol.methods.should include(Queue::DeclareOk)
27
+ end
28
+ end
29
+
30
+ describe AMQ::Protocol::Error do
31
+ it "should be an exception class" do
32
+ AMQ::Protocol::Error.should < Exception
33
+ end
34
+ end
35
+
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
53
+ end
54
+
55
+ it "should have method name equal to connection.start" do
56
+ Connection::Start.name.should eql("connection.start")
57
+ end
58
+
59
+ it "should have method equal to TODO" do
60
+ pending
61
+ Connection::Start.method.should eql("TODO")
62
+ end
63
+ end
64
+
65
+ describe AMQ::Protocol::Connection::StartOk do
66
+ it "should be a subclass of Method" do
67
+ Connection::StartOk.should < Method
68
+ end
69
+
70
+ it "should have method name equal to connection.start-ok" do
71
+ Connection::StartOk.name.should eql("connection.start-ok")
72
+ end
73
+
74
+ it "should have method equal to TODO" do
75
+ pending
76
+ Connection::StartOk.method.should eql("TODO")
77
+ end
78
+
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")
83
+ end
84
+ end
85
+ end
86
+
87
+ describe AMQ::Protocol::Connection::Secure do
88
+ it "should be a subclass of Method" do
89
+ Connection::Secure.should < Method
90
+ end
91
+
92
+ it "should have method name equal to connection.secure" do
93
+ Connection::Secure.name.should eql("connection.secure")
94
+ end
95
+
96
+ it "should have method equal to TODO" do
97
+ pending
98
+ Connection::Secure.method.should eql("TODO")
99
+ end
100
+ end
101
+
102
+ describe AMQ::Protocol::Connection::SecureOk do
103
+ it "should be a subclass of Method" do
104
+ Connection::SecureOk.should < Method
105
+ end
106
+
107
+ it "should have method name equal to connection.secure-ok" do
108
+ Connection::SecureOk.name.should eql("connection.secure-ok")
109
+ end
110
+
111
+ it "should have method equal to TODO" do
112
+ pending
113
+ Connection::SecureOk.method.should eql("TODO")
114
+ end
115
+ end
116
+
117
+ describe AMQ::Protocol::Connection::Tune do
118
+ it "should be a subclass of Method" do
119
+ Connection::Tune.should < Method
120
+ end
121
+
122
+ it "should have method name equal to connection.tune" do
123
+ Connection::Tune.name.should eql("connection.tune")
124
+ end
125
+
126
+ it "should have method equal to TODO" do
127
+ pending
128
+ Connection::Tune.method.should eql("TODO")
129
+ end
130
+ end
131
+
132
+ describe AMQ::Protocol::Connection::TuneOk do
133
+ it "should be a subclass of Method" do
134
+ Connection::TuneOk.should < Method
135
+ end
136
+
137
+ it "should have method name equal to connection.tune-ok" do
138
+ Connection::TuneOk.name.should eql("connection.tune-ok")
139
+ end
140
+
141
+ it "should have method equal to TODO" do
142
+ pending
143
+ Connection::TuneOk.method.should eql("TODO")
144
+ end
145
+
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")
150
+ end
151
+ end
152
+ end
153
+
154
+ describe AMQ::Protocol::Connection::Open do
155
+ it "should be a subclass of Method" do
156
+ Connection::Open.should < Method
157
+ end
158
+
159
+ it "should have method name equal to connection.open" do
160
+ Connection::Open.name.should eql("connection.open")
161
+ end
162
+
163
+ it "should have method equal to TODO" do
164
+ pending
165
+ Connection::Open.method.should eql("TODO")
166
+ end
167
+ end
168
+
169
+ describe AMQ::Protocol::Connection::OpenOk do
170
+ it "should be a subclass of Method" do
171
+ Connection::OpenOk.should < Method
172
+ end
173
+
174
+ it "should have method name equal to connection.open-ok" do
175
+ Connection::OpenOk.name.should eql("connection.open-ok")
176
+ end
177
+
178
+ it "should have method equal to TODO" do
179
+ pending
180
+ Connection::OpenOk.method.should eql("TODO")
181
+ end
182
+ end
183
+
184
+ describe AMQ::Protocol::Connection::Close do
185
+ it "should be a subclass of Method" do
186
+ Connection::Close.should < Method
187
+ end
188
+
189
+ it "should have method name equal to connection.close" do
190
+ Connection::Close.name.should eql("connection.close")
191
+ end
192
+
193
+ it "should have method equal to TODO" do
194
+ pending
195
+ Connection::Close.method.should eql("TODO")
196
+ end
197
+ end
198
+
199
+ describe AMQ::Protocol::Connection::CloseOk do
200
+ it "should be a subclass of Method" do
201
+ Connection::CloseOk.should < Method
202
+ end
203
+
204
+ it "should have method name equal to connection.close-ok" do
205
+ Connection::CloseOk.name.should eql("connection.close-ok")
206
+ end
207
+
208
+ it "should have method equal to TODO" do
209
+ pending
210
+ Connection::CloseOk.method.should eql("TODO")
211
+ end
212
+ end
213
+ end
214
+
215
+ describe AMQ::Protocol::Channel do
216
+ it "should be a subclass of Class" do
217
+ Channel.should < Class
218
+ end
219
+
220
+ it "should have name equal to channel" do
221
+ Channel.name.should eql("channel")
222
+ end
223
+
224
+ it "should have method equal to TODO" do
225
+ pending
226
+ Channel.method.should eql("TODO")
227
+ end
228
+
229
+ describe AMQ::Protocol::Channel::Open do
230
+ it "should be a subclass of Method" do
231
+ Channel::Open.should < Method
232
+ end
233
+
234
+ it "should have method name equal to channel.open" do
235
+ Channel::Open.name.should eql("channel.open")
236
+ end
237
+
238
+ it "should have method equal to TODO" do
239
+ pending
240
+ Channel::Open.method.should eql("TODO")
241
+ end
242
+ end
243
+
244
+ describe AMQ::Protocol::Channel::OpenOk do
245
+ it "should be a subclass of Method" do
246
+ Channel::OpenOk.should < Method
247
+ end
248
+
249
+ it "should have method name equal to channel.open-ok" do
250
+ Channel::OpenOk.name.should eql("channel.open-ok")
251
+ end
252
+
253
+ it "should have method equal to TODO" do
254
+ pending
255
+ Channel::OpenOk.method.should eql("TODO")
256
+ end
257
+ end
258
+
259
+ describe AMQ::Protocol::Channel::Flow do
260
+ it "should be a subclass of Method" do
261
+ Channel::Flow.should < Method
262
+ end
263
+
264
+ it "should have method name equal to channel.flow" do
265
+ Channel::Flow.name.should eql("channel.flow")
266
+ end
267
+
268
+ it "should have method equal to TODO" do
269
+ pending
270
+ Channel::Flow.method.should eql("TODO")
271
+ end
272
+ end
273
+
274
+ describe AMQ::Protocol::Channel::FlowOk do
275
+ it "should be a subclass of Method" do
276
+ Channel::FlowOk.should < Method
277
+ end
278
+
279
+ it "should have method name equal to channel.flow-ok" do
280
+ Channel::FlowOk.name.should eql("channel.flow-ok")
281
+ end
282
+
283
+ it "should have method equal to TODO" do
284
+ pending
285
+ Channel::FlowOk.method.should eql("TODO")
286
+ end
287
+ end
288
+
289
+ describe AMQ::Protocol::Channel::Close do
290
+ it "should be a subclass of Method" do
291
+ Channel::Close.should < Method
292
+ end
293
+
294
+ it "should have method name equal to channel.close" do
295
+ Channel::Close.name.should eql("channel.close")
296
+ end
297
+
298
+ it "should have method equal to TODO" do
299
+ pending
300
+ Channel::Close.method.should eql("TODO")
301
+ end
302
+ end
303
+
304
+ describe AMQ::Protocol::Channel::CloseOk do
305
+ it "should be a subclass of Method" do
306
+ Channel::CloseOk.should < Method
307
+ end
308
+
309
+ it "should have method name equal to channel.close-ok" do
310
+ Channel::CloseOk.name.should eql("channel.close-ok")
311
+ end
312
+
313
+ it "should have method equal to TODO" do
314
+ pending
315
+ Channel::CloseOk.method.should eql("TODO")
316
+ end
317
+ end
318
+ end
319
+
320
+ describe AMQ::Protocol::Exchange do
321
+ it "should be a subclass of Class" do
322
+ Exchange.should < Class
323
+ end
324
+
325
+ it "should have name equal to exchange" do
326
+ Exchange.name.should eql("exchange")
327
+ end
328
+
329
+ it "should have method equal to TODO" do
330
+ pending
331
+ Exchange.method.should eql("TODO")
332
+ end
333
+
334
+ describe AMQ::Protocol::Exchange::Declare do
335
+ it "should be a subclass of Method" do
336
+ Exchange::Declare.should < Method
337
+ end
338
+
339
+ it "should have method name equal to exchange.declare" do
340
+ Exchange::Declare.name.should eql("exchange.declare")
341
+ end
342
+
343
+ it "should have method equal to TODO" do
344
+ pending
345
+ Exchange::Declare.method.should eql("TODO")
346
+ end
347
+ end
348
+
349
+ describe AMQ::Protocol::Exchange::DeclareOk do
350
+ it "should be a subclass of Method" do
351
+ Exchange::DeclareOk.should < Method
352
+ end
353
+
354
+ it "should have method name equal to exchange.declare-ok" do
355
+ Exchange::DeclareOk.name.should eql("exchange.declare-ok")
356
+ end
357
+
358
+ it "should have method equal to TODO" do
359
+ pending
360
+ Exchange::DeclareOk.method.should eql("TODO")
361
+ end
362
+ end
363
+
364
+ describe AMQ::Protocol::Exchange::Delete do
365
+ it "should be a subclass of Method" do
366
+ Exchange::Delete.should < Method
367
+ end
368
+
369
+ it "should have method name equal to exchange.delete" do
370
+ Exchange::Delete.name.should eql("exchange.delete")
371
+ end
372
+
373
+ it "should have method equal to TODO" do
374
+ pending
375
+ Exchange::Delete.method.should eql("TODO")
376
+ end
377
+ end
378
+
379
+ describe AMQ::Protocol::Exchange::DeleteOk do
380
+ it "should be a subclass of Method" do
381
+ Exchange::DeleteOk.should < Method
382
+ end
383
+
384
+ it "should have method name equal to exchange.delete-ok" do
385
+ Exchange::DeleteOk.name.should eql("exchange.delete-ok")
386
+ end
387
+
388
+ it "should have method equal to TODO" do
389
+ pending
390
+ Exchange::DeleteOk.method.should eql("TODO")
391
+ end
392
+ end
393
+
394
+ describe AMQ::Protocol::Exchange::Bind do
395
+ it "should be a subclass of Method" do
396
+ Exchange::Bind.should < Method
397
+ end
398
+
399
+ it "should have method name equal to exchange.bind" do
400
+ Exchange::Bind.name.should eql("exchange.bind")
401
+ end
402
+
403
+ it "should have method equal to TODO" do
404
+ pending
405
+ Exchange::Bind.method.should eql("TODO")
406
+ end
407
+ end
408
+
409
+ describe AMQ::Protocol::Exchange::BindOk do
410
+ it "should be a subclass of Method" do
411
+ Exchange::BindOk.should < Method
412
+ end
413
+
414
+ it "should have method name equal to exchange.bind-ok" do
415
+ Exchange::BindOk.name.should eql("exchange.bind-ok")
416
+ end
417
+
418
+ it "should have method equal to TODO" do
419
+ pending
420
+ Exchange::BindOk.method.should eql("TODO")
421
+ end
422
+ end
423
+
424
+ describe AMQ::Protocol::Exchange::Unbind do
425
+ it "should be a subclass of Method" do
426
+ Exchange::Unbind.should < Method
427
+ end
428
+
429
+ it "should have method name equal to exchange.unbind" do
430
+ Exchange::Unbind.name.should eql("exchange.unbind")
431
+ end
432
+
433
+ it "should have method equal to TODO" do
434
+ pending
435
+ Exchange::Unbind.method.should eql("TODO")
436
+ end
437
+ end
438
+
439
+ describe AMQ::Protocol::Exchange::UnbindOk do
440
+ it "should be a subclass of Method" do
441
+ Exchange::UnbindOk.should < Method
442
+ end
443
+
444
+ it "should have method name equal to exchange.unbind-ok" do
445
+ Exchange::UnbindOk.name.should eql("exchange.unbind-ok")
446
+ end
447
+
448
+ it "should have method equal to TODO" do
449
+ pending
450
+ Exchange::UnbindOk.method.should eql("TODO")
451
+ end
452
+ end
453
+ end
454
+
455
+ describe AMQ::Protocol::Queue do
456
+ it "should be a subclass of Class" do
457
+ Queue.should < Class
458
+ end
459
+
460
+ it "should have name equal to queue" do
461
+ Queue.name.should eql("queue")
462
+ end
463
+
464
+ it "should have method equal to TODO" do
465
+ pending
466
+ Queue.method.should eql("TODO")
467
+ end
468
+
469
+ describe AMQ::Protocol::Queue::Declare do
470
+ it "should be a subclass of Method" do
471
+ Queue::Declare.should < Method
472
+ end
473
+
474
+ it "should have method name equal to queue.declare" do
475
+ Queue::Declare.name.should eql("queue.declare")
476
+ end
477
+
478
+ it "should have method equal to TODO" do
479
+ pending
480
+ Queue::Declare.method.should eql("TODO")
481
+ end
482
+ end
483
+
484
+ describe AMQ::Protocol::Queue::DeclareOk do
485
+ it "should be a subclass of Method" do
486
+ Queue::DeclareOk.should < Method
487
+ end
488
+
489
+ it "should have method name equal to queue.declare-ok" do
490
+ Queue::DeclareOk.name.should eql("queue.declare-ok")
491
+ end
492
+
493
+ it "should have method equal to TODO" do
494
+ pending
495
+ Queue::DeclareOk.method.should eql("TODO")
496
+ end
497
+ end
498
+
499
+ describe AMQ::Protocol::Queue::Bind do
500
+ it "should be a subclass of Method" do
501
+ Queue::Bind.should < Method
502
+ end
503
+
504
+ it "should have method name equal to queue.bind" do
505
+ Queue::Bind.name.should eql("queue.bind")
506
+ end
507
+
508
+ it "should have method equal to TODO" do
509
+ pending
510
+ Queue::Bind.method.should eql("TODO")
511
+ end
512
+ end
513
+
514
+ describe AMQ::Protocol::Queue::BindOk do
515
+ it "should be a subclass of Method" do
516
+ Queue::BindOk.should < Method
517
+ end
518
+
519
+ it "should have method name equal to queue.bind-ok" do
520
+ Queue::BindOk.name.should eql("queue.bind-ok")
521
+ end
522
+
523
+ it "should have method equal to TODO" do
524
+ pending
525
+ Queue::BindOk.method.should eql("TODO")
526
+ end
527
+ end
528
+
529
+ describe AMQ::Protocol::Queue::Purge do
530
+ it "should be a subclass of Method" do
531
+ Queue::Purge.should < Method
532
+ end
533
+
534
+ it "should have method name equal to queue.purge" do
535
+ Queue::Purge.name.should eql("queue.purge")
536
+ end
537
+
538
+ it "should have method equal to TODO" do
539
+ pending
540
+ Queue::Purge.method.should eql("TODO")
541
+ end
542
+ end
543
+
544
+ describe AMQ::Protocol::Queue::PurgeOk do
545
+ it "should be a subclass of Method" do
546
+ Queue::PurgeOk.should < Method
547
+ end
548
+
549
+ it "should have method name equal to queue.purge-ok" do
550
+ Queue::PurgeOk.name.should eql("queue.purge-ok")
551
+ end
552
+
553
+ it "should have method equal to TODO" do
554
+ pending
555
+ Queue::PurgeOk.method.should eql("TODO")
556
+ end
557
+ end
558
+
559
+ describe AMQ::Protocol::Queue::Delete do
560
+ it "should be a subclass of Method" do
561
+ Queue::Delete.should < Method
562
+ end
563
+
564
+ it "should have method name equal to queue.delete" do
565
+ Queue::Delete.name.should eql("queue.delete")
566
+ end
567
+
568
+ it "should have method equal to TODO" do
569
+ pending
570
+ Queue::Delete.method.should eql("TODO")
571
+ end
572
+ end
573
+
574
+ describe AMQ::Protocol::Queue::DeleteOk do
575
+ it "should be a subclass of Method" do
576
+ Queue::DeleteOk.should < Method
577
+ end
578
+
579
+ it "should have method name equal to queue.delete-ok" do
580
+ Queue::DeleteOk.name.should eql("queue.delete-ok")
581
+ end
582
+
583
+ it "should have method equal to TODO" do
584
+ pending
585
+ Queue::DeleteOk.method.should eql("TODO")
586
+ end
587
+ end
588
+
589
+ describe AMQ::Protocol::Queue::Unbind do
590
+ it "should be a subclass of Method" do
591
+ Queue::Unbind.should < Method
592
+ end
593
+
594
+ it "should have method name equal to queue.unbind" do
595
+ Queue::Unbind.name.should eql("queue.unbind")
596
+ end
597
+
598
+ it "should have method equal to TODO" do
599
+ pending
600
+ Queue::Unbind.method.should eql("TODO")
601
+ end
602
+ end
603
+
604
+ describe AMQ::Protocol::Queue::UnbindOk do
605
+ it "should be a subclass of Method" do
606
+ Queue::UnbindOk.should < Method
607
+ end
608
+
609
+ it "should have method name equal to queue.unbind-ok" do
610
+ Queue::UnbindOk.name.should eql("queue.unbind-ok")
611
+ end
612
+
613
+ it "should have method equal to TODO" do
614
+ pending
615
+ Queue::UnbindOk.method.should eql("TODO")
616
+ end
617
+ end
618
+ end
619
+
620
+ describe AMQ::Protocol::Basic do
621
+ it "should be a subclass of Class" do
622
+ Basic.should < Class
623
+ end
624
+
625
+ it "should have name equal to basic" do
626
+ Basic.name.should eql("basic")
627
+ end
628
+
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
636
+ end
637
+
638
+ it "should have method name equal to basic.qos" do
639
+ Basic::Qos.name.should eql("basic.qos")
640
+ end
641
+
642
+ it "should have method equal to TODO" do
643
+ pending
644
+ Basic::Qos.method.should eql("TODO")
645
+ end
646
+ end
647
+
648
+ describe AMQ::Protocol::Basic::QosOk do
649
+ it "should be a subclass of Method" do
650
+ Basic::QosOk.should < Method
651
+ end
652
+
653
+ it "should have method name equal to basic.qos-ok" do
654
+ Basic::QosOk.name.should eql("basic.qos-ok")
655
+ end
656
+
657
+ it "should have method equal to TODO" do
658
+ pending
659
+ Basic::QosOk.method.should eql("TODO")
660
+ end
661
+ end
662
+
663
+ describe AMQ::Protocol::Basic::Consume do
664
+ it "should be a subclass of Method" do
665
+ Basic::Consume.should < Method
666
+ end
667
+
668
+ it "should have method name equal to basic.consume" do
669
+ Basic::Consume.name.should eql("basic.consume")
670
+ end
671
+
672
+ it "should have method equal to TODO" do
673
+ pending
674
+ Basic::Consume.method.should eql("TODO")
675
+ end
676
+ end
677
+
678
+ describe AMQ::Protocol::Basic::ConsumeOk do
679
+ it "should be a subclass of Method" do
680
+ Basic::ConsumeOk.should < Method
681
+ end
682
+
683
+ it "should have method name equal to basic.consume-ok" do
684
+ Basic::ConsumeOk.name.should eql("basic.consume-ok")
685
+ end
686
+
687
+ it "should have method equal to TODO" do
688
+ pending
689
+ Basic::ConsumeOk.method.should eql("TODO")
690
+ end
691
+ end
692
+
693
+ describe AMQ::Protocol::Basic::Cancel do
694
+ it "should be a subclass of Method" do
695
+ Basic::Cancel.should < Method
696
+ end
697
+
698
+ it "should have method name equal to basic.cancel" do
699
+ Basic::Cancel.name.should eql("basic.cancel")
700
+ end
701
+
702
+ it "should have method equal to TODO" do
703
+ pending
704
+ Basic::Cancel.method.should eql("TODO")
705
+ end
706
+ end
707
+
708
+ describe AMQ::Protocol::Basic::CancelOk do
709
+ it "should be a subclass of Method" do
710
+ Basic::CancelOk.should < Method
711
+ end
712
+
713
+ it "should have method name equal to basic.cancel-ok" do
714
+ Basic::CancelOk.name.should eql("basic.cancel-ok")
715
+ end
716
+
717
+ it "should have method equal to TODO" do
718
+ pending
719
+ Basic::CancelOk.method.should eql("TODO")
720
+ end
721
+ end
722
+
723
+ describe AMQ::Protocol::Basic::Publish do
724
+ it "should be a subclass of Method" do
725
+ Basic::Publish.should < Method
726
+ end
727
+
728
+ it "should have method name equal to basic.publish" do
729
+ Basic::Publish.name.should eql("basic.publish")
730
+ end
731
+
732
+ it "should have method equal to TODO" do
733
+ pending
734
+ Basic::Publish.method.should eql("TODO")
735
+ end
736
+ end
737
+
738
+ describe AMQ::Protocol::Basic::Return do
739
+ it "should be a subclass of Method" do
740
+ Basic::Return.should < Method
741
+ end
742
+
743
+ it "should have method name equal to basic.return" do
744
+ Basic::Return.name.should eql("basic.return")
745
+ end
746
+
747
+ it "should have method equal to TODO" do
748
+ pending
749
+ Basic::Return.method.should eql("TODO")
750
+ end
751
+ end
752
+
753
+ describe AMQ::Protocol::Basic::Deliver do
754
+ it "should be a subclass of Method" do
755
+ Basic::Deliver.should < Method
756
+ end
757
+
758
+ it "should have method name equal to basic.deliver" do
759
+ Basic::Deliver.name.should eql("basic.deliver")
760
+ end
761
+
762
+ it "should have method equal to TODO" do
763
+ pending
764
+ Basic::Deliver.method.should eql("TODO")
765
+ end
766
+ end
767
+
768
+ describe AMQ::Protocol::Basic::Get do
769
+ it "should be a subclass of Method" do
770
+ Basic::Get.should < Method
771
+ end
772
+
773
+ it "should have method name equal to basic.get" do
774
+ Basic::Get.name.should eql("basic.get")
775
+ end
776
+
777
+ it "should have method equal to TODO" do
778
+ pending
779
+ Basic::Get.method.should eql("TODO")
780
+ end
781
+ end
782
+
783
+ describe AMQ::Protocol::Basic::GetOk do
784
+ it "should be a subclass of Method" do
785
+ Basic::GetOk.should < Method
786
+ end
787
+
788
+ it "should have method name equal to basic.get-ok" do
789
+ Basic::GetOk.name.should eql("basic.get-ok")
790
+ end
791
+
792
+ it "should have method equal to TODO" do
793
+ pending
794
+ Basic::GetOk.method.should eql("TODO")
795
+ end
796
+ end
797
+
798
+ describe AMQ::Protocol::Basic::GetEmpty do
799
+ it "should be a subclass of Method" do
800
+ Basic::GetEmpty.should < Method
801
+ end
802
+
803
+ it "should have method name equal to basic.get-empty" do
804
+ Basic::GetEmpty.name.should eql("basic.get-empty")
805
+ end
806
+
807
+ it "should have method equal to TODO" do
808
+ pending
809
+ Basic::GetEmpty.method.should eql("TODO")
810
+ end
811
+ end
812
+
813
+ describe AMQ::Protocol::Basic::Ack do
814
+ it "should be a subclass of Method" do
815
+ Basic::Ack.should < Method
816
+ end
817
+
818
+ it "should have method name equal to basic.ack" do
819
+ Basic::Ack.name.should eql("basic.ack")
820
+ end
821
+
822
+ it "should have method equal to TODO" do
823
+ pending
824
+ Basic::Ack.method.should eql("TODO")
825
+ end
826
+ end
827
+
828
+ describe AMQ::Protocol::Basic::Reject do
829
+ it "should be a subclass of Method" do
830
+ Basic::Reject.should < Method
831
+ end
832
+
833
+ it "should have method name equal to basic.reject" do
834
+ Basic::Reject.name.should eql("basic.reject")
835
+ end
836
+
837
+ it "should have method equal to TODO" do
838
+ pending
839
+ Basic::Reject.method.should eql("TODO")
840
+ end
841
+ end
842
+
843
+ describe AMQ::Protocol::Basic::RecoverAsync do
844
+ it "should be a subclass of Method" do
845
+ Basic::RecoverAsync.should < Method
846
+ end
847
+
848
+ it "should have method name equal to basic.recover-async" do
849
+ Basic::RecoverAsync.name.should eql("basic.recover-async")
850
+ end
851
+
852
+ it "should have method equal to TODO" do
853
+ pending
854
+ Basic::RecoverAsync.method.should eql("TODO")
855
+ end
856
+ end
857
+
858
+ describe AMQ::Protocol::Basic::Recover do
859
+ it "should be a subclass of Method" do
860
+ Basic::Recover.should < Method
861
+ end
862
+
863
+ it "should have method name equal to basic.recover" do
864
+ Basic::Recover.name.should eql("basic.recover")
865
+ end
866
+
867
+ it "should have method equal to TODO" do
868
+ pending
869
+ Basic::Recover.method.should eql("TODO")
870
+ end
871
+ end
872
+
873
+ describe AMQ::Protocol::Basic::RecoverOk do
874
+ it "should be a subclass of Method" do
875
+ Basic::RecoverOk.should < Method
876
+ end
877
+
878
+ it "should have method name equal to basic.recover-ok" do
879
+ Basic::RecoverOk.name.should eql("basic.recover-ok")
880
+ end
881
+
882
+ it "should have method equal to TODO" do
883
+ pending
884
+ Basic::RecoverOk.method.should eql("TODO")
885
+ end
886
+ end
887
+ end
888
+ end