File: blank_body_encoding_spec.rb

package info (click to toggle)
ruby-amq-protocol 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 392 kB
  • sloc: ruby: 4,212; python: 247; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# encoding: binary

require File.expand_path('../../../spec_helper', __FILE__)


describe AMQ::Protocol::Method, ".encode_body" do
  it "encodes 1-byte long payload as exactly 1 body frame" do
    described_class.encode_body('1', 1, 65536).size.should == 1
  end

  it "encodes 0-byte long (blank) payload as exactly 0 body frame" do
    described_class.encode_body('', 1, 65536).size.should == 0
  end
end