Sha256: 35398390f2155feb970c32a955b9eee606e685bc53f005c926f4f7437170828d

Contents?: true

Size: 999 Bytes

Versions: 4

Compression:

Stored size: 999 Bytes

Contents

# frozen_string_literal: true

require "introspection_test_helper"

describe GObjectIntrospection::ITypeInfo do
  describe "#name?" do
    let(:object_info) { get_introspection_data("GIMarshallingTests", "Object") }
    let(:vfunc_info) { object_info.find_vfunc("vfunc_array_out_parameter") }
    let(:arg_info) { vfunc_info.args[0] }
    let(:type_info) { arg_info.argument_type }

    it "raises an error" do
      _(proc { type_info.name }).must_raise RuntimeError
    end
  end

  describe "#interface" do
    describe "for unresolvable interface types" do
      let(:function_info) { get_introspection_data "GObject", "signal_set_va_marshaller" }
      let(:argument_info) { function_info.args.last }
      let(:type_info) { argument_info.argument_type }

      it "returns an IUnresolvableInfo object" do
        result = type_info.interface
        _(result.info_type).must_equal :unresolved
        _(result).must_be_kind_of GObjectIntrospection::IUnresolvedInfo
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 test/ffi-gobject_introspection/i_type_info_test.rb
gir_ffi-0.15.2 test/ffi-gobject_introspection/i_type_info_test.rb
gir_ffi-0.15.1 test/ffi-gobject_introspection/i_type_info_test.rb
gir_ffi-0.15.0 test/ffi-gobject_introspection/i_type_info_test.rb