Sha256: 0c4d970919d8f833a956fe9e2a5c39e40ac27691edacd2ccb276b5c9b0cd30de

Contents?: true

Size: 911 Bytes

Versions: 3

Compression:

Stored size: 911 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/ffi-gobject/object_class_test.rb
gir_ffi-0.9.1 test/ffi-gobject/object_class_test.rb
gir_ffi-0.9.0 test/ffi-gobject/object_class_test.rb