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.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ffi/library_spec.rb b/spec/ffi/library_spec.rb
index 14a8bc1..52a961f 100644
--- a/spec/ffi/library_spec.rb
+++ b/spec/ffi/library_spec.rb
@@ -5,6 +5,11 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
+module TestEnumValueRactor
+ extend FFI::Library
+ enum :something, [:one, :two]
+end
+
describe "Library" do
describe ".enum_value" do
m = Module.new do
@@ -20,6 +25,14 @@ describe "Library" do
it "should return nil for an invalid key" do
expect(m.enum_value(:three)).to be nil
end
+
+ it "should be queryable in Ractor", :ractor do
+ res = Ractor.new do
+ TestEnumValueRactor.enum_value(:one)
+ end.take
+
+ expect( res ).to eq(0)
+ end
end
describe "#ffi_convention" do