Sha256: 2a807d145cefc189c873433d723f1f17432d9bf84733703dcd49780bdb21183e

Contents?: true

Size: 764 Bytes

Versions: 6

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

require 'gir_ffi_test_helper'

describe GirFFI::InfoExt::ICallableInfo do
  let(:info_class) do
    Class.new do
      include GirFFI::InfoExt::ICallableInfo
    end
  end
  let(:callable_info) { info_class.new }

  describe '#argument_ffi_types' do
    describe 'for a simple callable with several arguments' do
      before do
        allow(arg_info1 = Object.new).to receive(:to_ffi_type).and_return :type1
        allow(arg_info2 = Object.new).to receive(:to_ffi_type).and_return :type2
        allow(callable_info).to receive(:args).and_return [arg_info1, arg_info2]
      end

      it 'returns the ffi types of the arguments' do
        callable_info.argument_ffi_types.must_equal [:type1, :type2]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.14.1 test/gir_ffi/info_ext/i_callable_info_test.rb
gir_ffi-0.14.0 test/gir_ffi/info_ext/i_callable_info_test.rb
gir_ffi-0.13.1 test/gir_ffi/info_ext/i_callable_info_test.rb
gir_ffi-0.13.0 test/gir_ffi/info_ext/i_callable_info_test.rb
gir_ffi-0.12.1 test/gir_ffi/info_ext/i_callable_info_test.rb
gir_ffi-0.12.0 test/gir_ffi/info_ext/i_callable_info_test.rb