Sha256: 005570ffa8a7c27bdd4e68f7cc96ddd312962e92a2d1e66a2af8cc238eea75cd

Contents?: true

Size: 885 Bytes

Versions: 4

Compression:

Stored size: 885 Bytes

Contents

# frozen_string_literal: true

require "gir_ffi_test_helper"

describe GirFFI::Builders::UnionBuilder do
  let(:union_info) { get_introspection_data("Regress", "FooBUnion") }
  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 Regress::FooBUnion" do
      _(builder.layout_specification).must_equal [:type, :int32, 0,
                                                  :v, :double, 0,
                                                  :rect, :pointer, 0]
    end
  end

  describe "#layout_superclass" do
    it "returns GirFFI::Union" do
      _(builder.layout_superclass).must_equal GirFFI::Union
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.15.2 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.15.1 test/gir_ffi/builders/union_builder_test.rb
gir_ffi-0.15.0 test/gir_ffi/builders/union_builder_test.rb