Sha256: 411754f9409d9d541b4f65f478deb57e2c7d2f9fcc7bc29768775f6b392c7f4b

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

#
# This file is part of ruby-ffi.
# For licensing, see LICENSE.SPECS
#

require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
require 'ffi'

describe "FFI" do

  describe ".map_library_name" do

    let(:prefix) { FFI::Platform::LIBPREFIX }
    let(:suffix) { FFI::Platform::LIBSUFFIX }
    
    it "should add platform library extension if not present" do
      FFI.map_library_name("#{prefix}dummy").should == "#{prefix}dummy.#{suffix}"
    end

    it "should add platform library extension even if lib suffix is present in name" do
      FFI.map_library_name("#{prefix}dummy_with_#{suffix}").should == "#{prefix}dummy_with_#{suffix}.#{suffix}"
    end

    it "should return Platform::LIBC when called with 'c'" do
      FFI.map_library_name('c').should == FFI::Library::LIBC
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffi-1.9.5-x64-mingw32 spec/ffi/ffi_spec.rb
ffi-1.9.5-x86-mingw32 spec/ffi/ffi_spec.rb
ffi-1.9.5 spec/ffi/ffi_spec.rb