Sha256: 67fd127e983020306a17aee391194e8b0ca89806752b4bc72656fa826de5b2d5

Contents?: true

Size: 1.48 KB

Versions: 64

Compression:

Stored size: 1.48 KB

Contents

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

  it { is_expected.to respond_to :search }
  it { is_expected.to respond_to :dfs }
  it { is_expected.to respond_to :csc_mask }
  it { is_expected.to respond_to :unique_filename }
  it { is_expected.to respond_to :extended_signature }

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

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

    it_behaves_like 'bit field with one flag set', :search, 'v', 0x0001
  end

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

    it_behaves_like 'bit field with one flag set', :dfs, 'v', 0x0002
  end

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

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

    it_behaves_like 'bit field with one flag set', :unique_filename, 'v', 0x0010
  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, 'v', 0x0020
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

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