Sha256: aef5ba2eb4ee955169779fa0db8b5cdc47595548112114a63d8ad341ed1132bb

Contents?: true

Size: 671 Bytes

Versions: 5

Compression:

Stored size: 671 Bytes

Contents

require File.expand_path('../gir_ffi_test_helper.rb', File.dirname(__FILE__))

describe GirFFI::InfoExt::ITypeInfo do
  describe "#layout_specification_type" do
    it "returns an array with elements subtype and size for type :array" do
      testclass = Class.new do
        include GirFFI::InfoExt::ITypeInfo
      end

      mock(subtype = Object.new).layout_specification_type { :foo }

      type = testclass.new
      mock(type).array_fixed_size { 2 }
      mock(type).param_type(0) { subtype }

      mock(GirFFI::Builder).itypeinfo_to_ffitype(type) { :array }

      result = type.layout_specification_type

      assert_equal [:foo, 2], result
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.4.0 test/unit/i_type_info_test.rb
gir_ffi-0.3.2 test/unit/i_type_info_test.rb
gir_ffi-0.3.1 test/unit/i_type_info_test.rb
gir_ffi-0.3.0 test/unit/i_type_info_test.rb
gir_ffi-0.2.3 test/unit/i_type_info_test.rb