Sha256: 1a66cb9c74e843804a277bb16b32974df58c73211ad8c5d7a27d354f7acabfef

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

RSpec.describe RubySMB::SMB1::BitField::TreeConnectFlags do
  subject(:flags) { described_class.new }

  it { is_expected.to respond_to :extended_response }
  it { is_expected.to respond_to :extended_signature }
  it { is_expected.to respond_to :disconnect }

  it 'is little endian' do
    expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
  end

  describe '#extended_response' do
    it 'should be a 1-bit field per the SMB spec' do
      expect(flags.extended_response).to be_a BinData::Bit1
    end

    it_behaves_like 'bit field with one flag set', :extended_response, 'C', 0x08
  end

  describe '#extended_signature' do
    it 'should be a 1-bit field per the SMB spec' do
      expect(flags.extended_signature).to be_a BinData::Bit1
    end

    it_behaves_like 'bit field with one flag set', :extended_signature, 'C', 0x04
  end

  describe '#disconnect' do
    it 'should be a 1-bit field per the SMB spec' do
      expect(flags.disconnect).to be_a BinData::Bit1
    end

    it_behaves_like 'bit field with one flag set', :disconnect, 'C', 0x01
  end


end

Version data entries

10 entries across 10 versions & 1 rubygems

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