Sha256: 73ee1c56c08c45756dbddde9f0657974506cce9f832272c8244e8147cbff9710

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

require 'gir_ffi_test_helper'

describe GirFFI::Builders::UnionBuilder do
  let(:union_info) { get_introspection_data('GObject', 'TypeCValue') }
  let(:builder) { GirFFI::Builders::UnionBuilder.new union_info }

  describe '#setup_instance_method' do
    it "returns nil looking for a method that doesn't exist" do
      builder.setup_instance_method('blub').must_be_nil
    end
  end

  describe '#layout_specification' do
    it 'returns the correct layout for GObject::TypeCValue' do
      long_type = FFI.type_size(:long) == 8 ? :int64 : :int32
      builder.layout_specification.must_equal [:v_int, :int32, 0,
                                               :v_long, long_type, 0,
                                               :v_int64, :int64, 0,
                                               :v_double, :double, 0,
                                               :v_pointer, :pointer, 0]
    end
  end

  describe '#layout_superclass' do
    it 'returns FFI::Union' do
      builder.layout_superclass.must_equal FFI::Union
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.9.1 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.9.0 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.6 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.5 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.4 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.3 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.2 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.1 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.8.0 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.7.10 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.7.9 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.7.8 test/gir_ffi/builders/union_builder_test.rb