Sha256: f699e12b7a687c0b42923329c2c113f4701ced287c3dff0873003562653e0ac3
Contents?: true
Size: 878 Bytes
Versions: 12
Compression:
Stored size: 878 Bytes
Contents
require 'gir_ffi_test_helper' describe GirFFI::InfoExt::IFieldInfo do let(:klass) { Class.new do include GirFFI::InfoExt::IFieldInfo end } let(:field_info) { klass.new } describe "#layout_specification" do it "returns an array of name, typespec and offset" do mock(type = Object.new).to_ffitype { :bar } mock(field_info).name { "foo" } mock(field_info).field_type { type } mock(field_info).offset { 0 } result = field_info.layout_specification assert_equal [:foo, :bar, 0], result end it "keeps a complex typespec intact" do mock(type = Object.new).to_ffitype { [:bar, 2] } mock(field_info).name { "foo" } mock(field_info).field_type { type } mock(field_info).offset { 0 } result = field_info.layout_specification assert_equal [:foo, [:bar, 2], 0], result end end end
Version data entries
12 entries across 12 versions & 1 rubygems