Skip to content

Commit

Permalink
Add test for error message of ffi_lib with empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Dec 18, 2024
1 parent 15a5537 commit 33c2705
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/natalie/ffi_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ module LibRubyParser
)
end

it 'raises an error if an empty list is provided' do
lambda do
Module.new do
extend FFI::Library
ffi_lib []
end
end.should raise_error(LoadError)
end

it 'links to a shared object' do
libs = LibRubyParser.instance_variable_get(:@ffi_libs)
libs.size.should == 1
Expand Down

0 comments on commit 33c2705

Please sign in to comment.