Sha256: 1e274ddd0a5b63f80b248a46b9e0e6573d6e827b297efdb9fe586eef4d85c10a

Contents?: true

Size: 1.25 KB

Versions: 28

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

RSpec.describe RubySMB::Fscc::FileInformation::FileStandardInformation do
  it 'references the correct class level' do
    expect(described_class).to be_const_defined(:CLASS_LEVEL)
    expect(described_class::CLASS_LEVEL).to be RubySMB::Fscc::FileInformation::FILE_STANDARD_INFORMATION
  end

  subject(:struct) { described_class.new }

  it { should respond_to :allocation_size }
  it { should respond_to :end_of_file }
  it { should respond_to :number_of_links }
  it { should respond_to :delete_pending }
  it { should respond_to :directory }

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

  it 'tracks the allocation size in a Int64 field' do
    expect(struct.allocation_size).to be_a BinData::Int64le
  end

  it 'tracks the file size in a Int64 field' do
    expect(struct.end_of_file).to be_a BinData::Int64le
  end

  it 'tracks the number of links in a Uint32 field' do
    expect(struct.number_of_links).to be_a BinData::Uint32le
  end

  it 'tracks if a delete is pending in a Int8 field' do
    expect(struct.delete_pending).to be_a BinData::Int8
  end

  it 'tracks if it is a directory in a Int8 field' do
    expect(struct.directory).to be_a BinData::Int8
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

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