Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Stop using Double in cache store tests (#2854)

hq1b8e96b948feb
diff --git a/test/plausible/session/cache_store_test.exs b/test/plausible/session/cache_store_test.exs
index 265d17df48..6b8d212700 100644
--- a/test/plausible/session/cache_store_test.exs
+++ b/test/plausible/session/cache_store_test.exs
@@ -1,14 +1,16 @@
defmodule Plausible.Session.CacheStoreTest do
use Plausible.DataCase
- import Double
- alias Plausible.Session.{CacheStore, WriteBuffer}
+ alias Plausible.Session.CacheStore
- setup do
- buffer =
- WriteBuffer
- |> stub(:insert, fn _sessions -> nil end)
+ defmodule FakeBuffer do
+ def insert(sessions) do
+ send(self(), {WriteBuffer, :insert, [sessions]})
+ {:ok, sessions}
+ end
+ end
- [buffer: buffer]
+ setup do
+ [buffer: FakeBuffer]
end
test "creates a session from an event", %{buffer: buffer} do