From 98fddf4c9eba7f7fc0a3ca16ba740e0eac479f3b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 7 Dec 2023 20:06:31 +1300 Subject: [PATCH] Add test for proxy -> promise. --- test/async/actor/proxy.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/async/actor/proxy.rb b/test/async/actor/proxy.rb index 086f9b2..96fa714 100644 --- a/test/async/actor/proxy.rb +++ b/test/async/actor/proxy.rb @@ -28,6 +28,14 @@ expect(actor.delete(:foo, return_value: :ignore)).to be == nil end + + it "can wait for the result" do + actor[:foo] = 1 + + variable = actor.delete(:foo, return_value: :promise) + + expect(variable.get).to be == 1 + end end describe Async::Actor::Proxy::Finalizer do