Sha256: ce9a71faa63d19fc27dc75ccc747e1cc9579108994e444e444ffe816229bbb47

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

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

describe GirFFI::Builder do
  describe ".itypeinfo_to_callback_ffitype" do
    describe "for an :interface argument" do
      setup do
        @iface = Object.new
        stub(@info = Object.new).interface { @iface }
        stub(@info).tag { :interface }
        stub(@info).pointer? { false }
      end

      it "correctly maps a :union argument to :pointer" do
        stub(@iface).info_type { :union }

        result = GirFFI::Builder.itypeinfo_to_callback_ffitype @info

        assert_equal :pointer, result
      end

      it "correctly maps a :flags argument to :int32" do
        stub(@iface).info_type { :flags }

        result = GirFFI::Builder.itypeinfo_to_callback_ffitype @info

        assert_equal :int32, result
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gir_ffi-0.1.0 test/unit/builder_test.rb