Sha256: 664334320acda9a8dd2e73c532c7cc672433e21309b43ed16256351ee1b30322

Contents?: true

Size: 820 Bytes

Versions: 10

Compression:

Stored size: 820 Bytes

Contents

require 'gir_ffi_test_helper'

describe GirFFI::Builders::InterfaceBuilder do
  let(:interface_builder) do
    GirFFI::Builders::InterfaceBuilder.new(
      get_introspection_data('Regress', 'TestInterface'))
  end

  describe '#build_class' do
    before do
      info = get_introspection_data 'GObject', 'TypePlugin'
      @bldr = GirFFI::Builders::InterfaceBuilder.new info
      @iface = @bldr.build_class
    end

    it 'builds an interface as a module' do
      assert_instance_of Module, @iface
    end

    it 'creates methods on the interface' do
      assert_defines_instance_method @iface, :complete_interface_info
    end
  end

  describe '#interface_struct' do
    it 'returns the interface struct type' do
      interface_builder.interface_struct.must_equal Regress::TestInterfaceIface
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.9.1 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.9.0 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.6 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.5 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.4 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.3 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.2 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.1 test/gir_ffi/builders/interface_builder_test.rb
gir_ffi-0.8.0 test/gir_ffi/builders/interface_builder_test.rb