Sha256: 5842a6a0131da59db0b24156b676d939318d4b8d35ae4c036d14eb4019aaf349

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true
require 'gir_ffi_test_helper'

GirFFI.setup :GIMarshallingTests

describe GirFFI::Builders::UnintrospectableBoxedBuilder do
  let(:instance) { GIMarshallingTests::PropertiesObject.new }
  let(:property) { instance.object_class.find_property 'some-boxed-glist' }
  let(:gtype) { property.value_type }
  let(:info) { GirFFI::UnintrospectableBoxedInfo.new(gtype) }
  let(:bldr) { GirFFI::Builders::UnintrospectableBoxedBuilder.new(info) }
  let(:klass) { bldr.build_class }

  before do
    skip unless get_property_introspection_data('GIMarshallingTests',
                                                'PropertiesObject',
                                                'some-boxed-glist')
  end

  it 'builds a class' do
    klass.must_be_instance_of Class
  end

  it 'builds a class derived from GirFFI::BoxedBase' do
    klass.ancestors.must_include GirFFI::BoxedBase
  end

  it 'returns the same class when built again' do
    other_bldr = GirFFI::Builders::UnintrospectableBoxedBuilder.new(info)
    other_klass = other_bldr.build_class

    other_klass.must_equal klass
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.11.0 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.10.2 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.10.1 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.10.0 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.10.0.pre1 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.9.5 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.9.4 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.9.3 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb