Sha256: 7c464115ad47dc30971b4cc16f812bf7ae871bd03f2b1c9c7be6f9b91d983c57

Contents?: true

Size: 1.45 KB

Versions: 63

Compression:

Stored size: 1.45 KB

Contents

RSpec.describe RubySMB::SMB1::Packet::WriteAndxResponse do
  subject(:packet) { described_class.new }

  describe '#smb_header' do
    subject(:header) { packet.smb_header }

    it 'is a standard SMB Header' do
      expect(header).to be_a RubySMB::SMB1::SMBHeader
    end

    it 'should have the command set to SMB_COM_WRITE_ANDX' do
      expect(header.command).to eq RubySMB::SMB1::Commands::SMB_COM_WRITE_ANDX
    end

    it 'should have the response flag set' do
      expect(header.flags.reply).to eq 1
    end
  end

  describe '#parameter_block' do
    subject(:parameter_block) { packet.parameter_block }

    it 'is a standard ParameterBlock' do
      expect(parameter_block).to be_a RubySMB::SMB1::ParameterBlock
    end

    it 'is little endian' do
      expect(parameter_block.get_parameter(:endian).endian).to eq :little
    end

    it { is_expected.to respond_to :andx_block }
    it { is_expected.to respond_to :count_low }
    it { is_expected.to respond_to :available }
    it { is_expected.to respond_to :count_high }

    describe '#andx_block' do
      it 'is a AndXBlock struct' do
        expect(parameter_block.andx_block).to be_a RubySMB::SMB1::AndXBlock
      end
    end
  end

  describe '#data_block' do
    subject(:data_block) { packet.data_block }

    it 'is a standard DataBlock' do
      expect(data_block).to be_a RubySMB::SMB1::DataBlock
    end

    it 'should be empty' do
      expect(data_block.byte_count).to eq(0)
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
ruby_smb-3.3.12 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.11 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.10 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.9 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.7 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.6 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.5 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.4 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.3 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.2 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.1 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.3.0 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.8 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.7 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.6 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.5 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.4 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.3 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.2 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb
ruby_smb-3.2.1 spec/lib/ruby_smb/smb1/packet/write_andx_response_spec.rb