Sha256: 52db35411759d7f3521c1db38f581223e08295049362f0d0cdd97c6e46793bf3

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# encoding: binary

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


module AMQ
  module Protocol
    class Confirm
      describe Select do
        describe '.decode' do
          subject do
            Select.decode("\x01")
          end
          
          its(:nowait) { should be_truthy }
        end
        
        describe '.encode' do
          it 'encodes the parameters into a MethodFrame' do
            channel = 1
            nowait = true
            method_frame = Select.encode(channel, nowait)
            expect(method_frame.payload).to eq("\x00U\x00\n\x01")
            expect(method_frame.channel).to eq(1)
          end
        end
      end
      
      describe SelectOk do
        # describe '.decode' do
        # end
        
        describe '.encode' do
          it 'encodes the parameters into a MethodFrame' do
            channel = 1
            method_frame = SelectOk.encode(channel)
            expect(method_frame.payload).to eq("\000U\000\v")
            expect(method_frame.channel).to eq(1)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
amq-protocol-2.2.0 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.1.0 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.0.1 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.0.0 spec/amq/protocol/confirm_spec.rb