Sha256: e3b0832cfb019e910e6276c06adc2f540ff9f9470343f200c896fa97c900e526

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 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

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 test/gir_ffi/g_type_test.rb
gir_ffi-0.15.2 test/gir_ffi/g_type_test.rb
gir_ffi-0.15.1 test/gir_ffi/g_type_test.rb
gir_ffi-0.15.0 test/gir_ffi/g_type_test.rb