Sha256: 7c674266db39229f7bf13676aac0d55d667cb8707066a4ca0a1ef030098e4be7

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "easier ffi" do

  it "should allow the old way still" do
    
    module Hello
      extend FFI::Library
      ffi_lib 'msvcrt'
      attach_function 'puts', [ :string ], :int
    end

    Hello.puts("Hello, World")
    
    module Hello
      extend FFI::EZ
      ffi_lib 'msvcrt'
      attach_function 'puts', [ :string ], :int
    end
    Hello.puts("Hello, World")

  end

  it "should allow the new way" do
    module Hello2
      extend FFI::EZ # a new attach_function
      ffi_lib 'msvcrt'
      attach_ez 'puts', [:string] => :int
    end
    Hello2.puts "yoyo"
  end
  
  it "should work with just the new EZ" do
      module Test3
         extend FFI::EZ
         ffi_lib 'msvcrt'
         attach_ez 'puts', [:string] => :int
      end
    end

  it "should work with a different name" do
    module Text3
      extend FFI::EZ
      ffi_lib 'msvcrt'
      attach_ez 'puts' => :puts, [:string] => :int
    end
  end

  it "should auto parse for you (?)"
  
  it "should allow for :lib => something"

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffi_ez-0.0.0 spec/spec.ffi_easier.rb