Skip to content

Commit c39471c

Browse files
committed
update tests to used the new function names
1 parent 6cf3c67 commit c39471c

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

test/scenic/cache_test.exs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,29 +426,37 @@ defmodule Scenic.CacheTest do
426426

427427
test "request & stop notification put" do
428428
assert Registry.keys(@cache_registry, self()) == []
429-
Cache.request_notification(@cache_put)
429+
Cache.subscribe(@cache_put)
430430
assert Registry.keys(@cache_registry, self()) == [@cache_put]
431-
Cache.stop_notification(@cache_put)
431+
Cache.unsubscribe(@cache_put)
432432
assert Registry.keys(@cache_registry, self()) == []
433433
end
434434

435435
test "request & stop notification delete" do
436436
assert Registry.keys(@cache_registry, self()) == []
437-
Cache.request_notification(@cache_delete)
437+
Cache.subscribe(@cache_delete)
438438
assert Registry.keys(@cache_registry, self()) == [@cache_delete]
439-
Cache.stop_notification(@cache_delete)
439+
Cache.unsubscribe(@cache_delete)
440440
assert Registry.keys(@cache_registry, self()) == []
441441
end
442442

443443
test "request & stop notification claim" do
444444
assert Registry.keys(@cache_registry, self()) == []
445-
Cache.request_notification(@cache_claim)
445+
Cache.subscribe(@cache_claim)
446446
assert Registry.keys(@cache_registry, self()) == [@cache_claim]
447-
Cache.stop_notification(@cache_claim)
447+
Cache.unsubscribe(@cache_claim)
448448
assert Registry.keys(@cache_registry, self()) == []
449449
end
450450

451451
test "request & stop notification release" do
452+
assert Registry.keys(@cache_registry, self()) == []
453+
Cache.subscribe(@cache_release)
454+
assert Registry.keys(@cache_registry, self()) == [@cache_release]
455+
Cache.unsubscribe(@cache_release)
456+
assert Registry.keys(@cache_registry, self()) == []
457+
end
458+
459+
test "deprecated start/stop still work`" do
452460
assert Registry.keys(@cache_registry, self()) == []
453461
Cache.request_notification(@cache_release)
454462
assert Registry.keys(@cache_registry, self()) == [@cache_release]
@@ -480,15 +488,15 @@ defmodule Scenic.CacheTest do
480488
refute Cache.member?("test_key")
481489

482490
# sign up for notifications
483-
Cache.request_notification(@cache_put)
491+
Cache.subscribe(@cache_put)
484492
refute_received({:"$gen_cast", {:cache_put, _}})
485493

486494
# put the key. This should send a notification
487495
Cache.put("test_key", 123)
488496
assert_received({:"$gen_cast", {:cache_put, "test_key"}})
489497

490-
# stop notifications
491-
Cache.stop_notification()
498+
# stop notificationsunsubscribe
499+
Cache.unsubscribe()
492500
Cache.put("test_key1", 123)
493501
refute_received({:"$gen_cast", {:cache_put, _}})
494502
end

0 commit comments

Comments
 (0)