Sha256: 5c016fb50ffd5f475108c2b4e05dfa191434f4714dd2a5764e0a536a656f81e5

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 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(:boxed_class) { bldr.build_class }

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

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

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

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

    other_class.must_equal boxed_class
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gir_ffi-0.13.0 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.12.1 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb
gir_ffi-0.12.0 test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb