Sha256: eaa58a7758b2a66518f8a2918beb0632e7aaa1afe10f13a5eba43693ab01b388

Contents?: true

Size: 799 Bytes

Versions: 9

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true
require 'gir_ffi_test_helper'

require 'gir_ffi/g_type'

describe GirFFI::GType do
  let(:gobject_gtype) { GObject::Object.gtype }
  let(:gobject_type_query) { GObject.type_query gobject_gtype }

  describe '#to_i' do
    it 'returns the integer gtype' do
      gt = GirFFI::GType.new(gobject_gtype)
      gt.to_i.must_equal gobject_gtype
    end
  end

  describe '#class_size' do
    it 'returns the class size for object types' do
      gt = GirFFI::GType.new(gobject_gtype)
      gt.class_size.must_equal gobject_type_query.class_size
    end
  end

  describe '#instance_size' do
    it 'returns the instance size for object types' do
      gt = GirFFI::GType.new(gobject_gtype)
      gt.instance_size.must_equal gobject_type_query.instance_size
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 test/gir_ffi/g_type_test.rb
gir_ffi-0.11.0 test/gir_ffi/g_type_test.rb
gir_ffi-0.10.2 test/gir_ffi/g_type_test.rb
gir_ffi-0.10.1 test/gir_ffi/g_type_test.rb
gir_ffi-0.10.0 test/gir_ffi/g_type_test.rb
gir_ffi-0.10.0.pre1 test/gir_ffi/g_type_test.rb
gir_ffi-0.9.5 test/gir_ffi/g_type_test.rb
gir_ffi-0.9.4 test/gir_ffi/g_type_test.rb
gir_ffi-0.9.3 test/gir_ffi/g_type_test.rb