Sha256: bdb72e9bb8bc767b12e3c1af75a9242f5e8cdddc366d884d470422eea38fd3b0

Contents?: true

Size: 1.33 KB

Versions: 10

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

RSpec.describe RubySMB::SMB1::Packet::TreeConnectRequest 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_NEGOTIATE' do
      expect(header.command).to eq RubySMB::SMB1::Commands::SMB_COM_TREE_CONNECT
    end

    it 'should not have the response flag set' do
      expect(header.flags.reply).to eq 0
    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_expected.to respond_to :andx_block }
    it { is_expected.to respond_to :flags }
    it { is_expected.to respond_to :password_length }

    it 'has an AndXBlock' do
      expect(parameter_block.andx_block).to be_a RubySMB::SMB1::AndXBlock
    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 { is_expected.to respond_to :password }
    it { is_expected.to respond_to :path }
    it { is_expected.to respond_to :service }

  end


end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby_smb-0.0.18 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.17 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.16 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.15 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.14 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.13 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.12 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.11 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.10 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb
ruby_smb-0.0.9 spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb