Sha256: cae1ad6140a65a2f35188d549a8edabe681edd9578ceca888df00320a30f1c81

Contents?: true

Size: 1.22 KB

Versions: 38

Compression:

Stored size: 1.22 KB

Contents

RSpec.describe RubySMB::Dcerpc::PSyntaxIdT do
  subject(:packet) { described_class.new }

  it { is_expected.to respond_to :if_uuid }
  it { is_expected.to respond_to :if_ver_major }
  it { is_expected.to respond_to :if_ver_minor }

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

  it 'has :byte_align parameter set to the expected value' do
    expect(described_class.default_parameters[:byte_align]).to eq(4)
  end

  describe '#if_uuid' do
    it 'is a Uuid' do
      expect(packet.if_uuid).to be_a RubySMB::Dcerpc::Uuid
    end
  end

  describe '#if_ver_major' do
    it 'should be a NdrUint16' do
      expect(packet.if_ver_major).to be_a RubySMB::Dcerpc::Ndr::NdrUint16
    end
  end

  describe '#if_ver_minor' do
    it 'should be a NdrUint16' do
      expect(packet.if_ver_minor).to be_a RubySMB::Dcerpc::Ndr::NdrUint16
    end
  end

  it 'reads its own binary representation and output the same packet' do
    packet = described_class.new(
      if_uuid: '22fd0d58-357a-472d-9d03-5f19e09b3a92',
      if_ver_major: rand(0xFF),
      if_ver_minor: rand(0xFF)
    )
    binary = packet.to_binary_s
    expect(described_class.read(binary)).to eq(packet)
  end

end

Version data entries

38 entries across 38 versions & 1 rubygems

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