Sha256: 81ae953ebd1abf0a480f874e0b8ce99c666497241dc66a2500b835b32022bec3

Contents?: true

Size: 948 Bytes

Versions: 4

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true

require "gir_ffi_test_helper"

require "ffi-gobject"

describe GObject::ObjectClass do
  describe "#list_properties" do
    it "returns GIMarshallingTests::OverridesObject's properties" do
      obj = GIMarshallingTests::OverridesObject.new
      object_class = GObject.object_class_from_instance obj

      info = get_introspection_data "GIMarshallingTests", "OverridesObject"
      expected_props = info.properties.map(&:name)
      expected_props += info.parent.properties.map(&:name)

      props = object_class.list_properties
      prop_names = props.map(&:get_name)

      _(prop_names.sort).must_equal expected_props.sort
    end
  end

  describe "#gtype" do
    it "returns the correct GType" do
      obj = GIMarshallingTests::OverridesObject.new
      object_class = GObject.object_class_from_instance obj
      _(object_class.gtype).must_equal GIMarshallingTests::OverridesObject.gtype
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 test/ffi-gobject/object_class_test.rb
gir_ffi-0.15.2 test/ffi-gobject/object_class_test.rb
gir_ffi-0.15.1 test/ffi-gobject/object_class_test.rb
gir_ffi-0.15.0 test/ffi-gobject/object_class_test.rb