Sha256: 4e7370ad7f154b033ce5a8324fc9515d0726982ae821361a8c96c7422cfd1e25

Contents?: true

Size: 735 Bytes

Versions: 10

Compression:

Stored size: 735 Bytes

Contents

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

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

10 entries across 10 versions & 2 rubygems

Version Path
ffi-1.0.4-x86-mingw32 spec/ffi/ffi_spec.rb
ffi-1.0.4 spec/ffi/ffi_spec.rb
ffi-1.0.3-x86-mingw32 spec/ffi/ffi_spec.rb
ffi-1.0.3 spec/ffi/ffi_spec.rb
ffi-1.0.2-x86-mingw32 spec/ffi/ffi_spec.rb
ffi-1.0.2 spec/ffi/ffi_spec.rb
ffi-1.0.1-x86-mingw32 spec/ffi/ffi_spec.rb
ffi-1.0.1 spec/ffi/ffi_spec.rb
ffi-1.0.0 spec/ffi/ffi_spec.rb
ffi-aitrus-0.9.0.beta spec/ffi/ffi_spec.rb