spec/amq/protocol/queue_spec.rb in amq-protocol-1.9.2 vs spec/amq/protocol/queue_spec.rb in amq-protocol-2.0.0
- old
+ new
@@ -16,25 +16,25 @@
exclusive = true
auto_delete = true
nowait = false
arguments = nil
method_frame = Declare.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
- method_frame.payload.should == "\x002\x00\n\x00\x00\vhello.world\x0E\x00\x00\x00\x00"
- method_frame.channel.should == 1
+ expect(method_frame.payload).to eq("\x002\x00\n\x00\x00\vhello.world\x0E\x00\x00\x00\x00")
+ expect(method_frame.channel).to eq(1)
end
end
end
describe DeclareOk do
describe '.decode' do
subject do
DeclareOk.decode(" amq.gen-KduGSqQrpeUo1otnU0TWSA==\x00\x00\x00\x00\x00\x00\x00\x00")
end
- its(:queue) { should == 'amq.gen-KduGSqQrpeUo1otnU0TWSA==' }
- its(:message_count) { should == 0 }
- its(:consumer_count) { should == 0 }
+ its(:queue) { should eq('amq.gen-KduGSqQrpeUo1otnU0TWSA==') }
+ its(:message_count) { should eq(0) }
+ its(:consumer_count) { should eq(0) }
end
end
describe Bind do
describe '.encode' do
@@ -44,12 +44,12 @@
exchange = 'foo.bar'
routing_key = 'xyz'
nowait = false
arguments = nil
method_frame = Bind.encode(channel, queue, exchange, routing_key, nowait, arguments)
- method_frame.payload.should == "\x002\x00\x14\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00\x00"
- method_frame.channel.should == 1
+ expect(method_frame.payload).to eq("\x002\x00\x14\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00\x00")
+ expect(method_frame.channel).to eq(1)
end
end
end
# describe BindOk do
@@ -62,23 +62,23 @@
it 'encodes the parameters into a MethodFrame' do
channel = 1
queue = 'hello.world'
nowait = false
method_frame = Purge.encode(channel, queue, nowait)
- method_frame.payload.should == "\x002\x00\x1E\x00\x00\vhello.world\x00"
- method_frame.channel.should == 1
+ expect(method_frame.payload).to eq("\x002\x00\x1E\x00\x00\vhello.world\x00")
+ expect(method_frame.channel).to eq(1)
end
end
end
describe PurgeOk do
describe '.decode' do
subject do
PurgeOk.decode("\x00\x00\x00\x02")
end
- its(:message_count) { should == 2 }
+ its(:message_count) { should eq(2) }
end
end
describe Delete do
describe '.encode' do
@@ -87,23 +87,23 @@
queue = 'hello.world'
if_unused = false
if_empty = false
nowait = false
method_frame = Delete.encode(channel, queue, if_unused, if_empty, nowait)
- method_frame.payload.should == "\x002\x00(\x00\x00\vhello.world\x00"
- method_frame.channel.should == 1
+ expect(method_frame.payload).to eq("\x002\x00(\x00\x00\vhello.world\x00")
+ expect(method_frame.channel).to eq(1)
end
end
end
describe DeleteOk do
describe '.decode' do
subject do
DeleteOk.decode("\x00\x00\x00\x02")
end
- its(:message_count) { should == 2 }
+ its(:message_count) { should eq(2) }
end
end
describe Unbind do
describe '.encode' do
@@ -112,11 +112,11 @@
queue = 'hello.world'
exchange = 'foo.bar'
routing_key = 'xyz'
arguments = nil
method_frame = Unbind.encode(channel, queue, exchange, routing_key, arguments)
- method_frame.payload.should == "\x002\x002\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00"
- method_frame.channel.should == 1
+ expect(method_frame.payload).to eq("\x002\x002\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00")
+ expect(method_frame.channel).to eq(1)
end
end
end
# describe UnbindOk do