Sha256: 5deddd1bff24bea6081b7bbbacc707b880975b6dbd472107a7ab64c0fdb53983

Contents?: true

Size: 1018 Bytes

Versions: 5

Compression:

Stored size: 1018 Bytes

Contents

# encoding: binary

module AMQ
  module Protocol
    class Confirm
      RSpec.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

      RSpec.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

5 entries across 5 versions & 1 rubygems

Version Path
amq-protocol-2.3.2 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.3.1 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.3.0 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.3.0.rc2 spec/amq/protocol/confirm_spec.rb
amq-protocol-2.3.0.rc1 spec/amq/protocol/confirm_spec.rb