aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/core_test.exs')
-rw-r--r--test/core_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/core_test.exs b/test/core_test.exs
index 74ae4cb..4949bda 100644
--- a/test/core_test.exs
+++ b/test/core_test.exs
@@ -80,6 +80,19 @@ defmodule Lkn.Core.Test do
Option.some(4) = Lkn.Core.Entity.read(entity_key, :level)
end
+ test "spawning puppeteer just to stop it" do
+ puppeteer_key = UUID.uuid4()
+
+ {:ok, _} = Test.Puppeteer.start_link(puppeteer_key)
+
+ Lkn.Core.Puppeteer.stop(puppeteer_key)
+
+ receive do
+ {:destroyed, key} -> assert puppeteer_key == key
+ after 100 -> raise "should have received a destroy notification already"
+ end
+ end
+
test "spawning puppeteer and testing its private cast" do
puppeteer_key = UUID.uuid4()
@@ -497,6 +510,10 @@ defmodule Test.Puppeteer do
state
end
+ def destroy(puppeteer_key, state, _instance_key, _reason) do
+ send state, {:destroyed, puppeteer_key}
+ end
+
def leave_instance(target, _instance_key) do
send(target, :kick)
target