Sha256: d43714cf9e2fd432068677d5727035225129addc0b02856e7657bfc3e77e80ba

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true
require 'introspection_test_helper'

describe GObjectIntrospection::IObjectInfo do
  let(:object_info) { get_introspection_data('GObject', 'Object') }

  describe '#find_vfunc' do
    it 'finds a vfunc by name string' do
      object_info.find_vfunc('finalize').wont_be_nil
    end

    it 'finds a vfunc by name symbol' do
      object_info.find_vfunc(:finalize).wont_be_nil
    end
  end

  describe '#find_method' do
    it 'finds a method by name string' do
      object_info.find_method('bind_property').wont_be_nil
    end

    it 'finds a method by name symbol' do
      object_info.find_method(:bind_property).wont_be_nil
    end
  end

  describe '#find_property' do
    let(:object_info) { get_introspection_data('GObject', 'Binding') }

    it 'finds a property by name string' do
      object_info.find_property('source-property').wont_be_nil
    end

    it 'finds a property by snake case string' do
      object_info.find_property('source_property').wont_be_nil
    end

    it 'finds a property by name symbol' do
      object_info.find_property(:source).wont_be_nil
    end
  end

  describe '#type_name' do
    it 'returns the correct name' do
      object_info.type_name.must_equal 'GObject'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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