spec/amq/protocol/method_spec.rb in amq-protocol-1.7.0 vs spec/amq/protocol/method_spec.rb in amq-protocol-1.8.0
- old
+ new
@@ -32,9 +32,17 @@
expected_payload_size = 92
body_frames = Method.encode_body(lipsum, 1, frame_size)
body_frames.map(&:payload).should == lipsum.split('').each_slice(expected_payload_size).map(&:join)
end
end
+
+ context 'when the body fits perfectly in a single frame' do
+ it 'encodes a body into a single BodyFrame' do
+ body_frames = Method.encode_body('*' * 131064, 1, 131072)
+ body_frames.first.payload.should == '*' * 131064
+ body_frames.should have(1).item
+ end
+ end
end
end
end
end