summaryrefslogtreecommitdiff
path: root/spec/ffi/library_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ffi/library_spec.rb')
-rw-r--r--spec/ffi/library_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ffi/library_spec.rb b/spec/ffi/library_spec.rb
index 4359b93..c4900d3 100644
--- a/spec/ffi/library_spec.rb
+++ b/spec/ffi/library_spec.rb
@@ -96,6 +96,16 @@ describe "Library" do
}.not_to raise_error
end
+ it "loads library using symbol" do
+ expect {
+ expect(Module.new do |m|
+ m.extend FFI::Library
+ ffi_lib :c
+ attach_function :getpid, [ ], :uint
+ end.getpid).to eq(Process.pid)
+ }.not_to raise_error
+ end
+
it "attach_function :getpid from [ 'c', 'libc.so.6'] " do
expect {
expect(Module.new do |m|