-defmodule ClusterKvTest do
+defmodule ClusterKVTest do
use ExUnit.Case
- doctest ClusterKv
+ doctest ClusterKV
- test "greets the world" do
- assert ClusterKv.hello() == :world
+ @topologies [
+ test: [
+ strategy: Cluster.Strategy.Epmd,
+ config: [hosts: []]
+ ]
+ ]
+
+ setup_all do
+ db = ClusterKV.start_link(name: TestCluster, topologies: @topologies, replicas: 1, quorum: 1)
+ [db: TestCluster]
+ end
+
+ test "test", %{db: db} do
+ ClusterKV.put(db, "test1", :hello)
+ ClusterKV.put(db, "test1", :world)
+ assert {"test1", [:world, :hello]} = ClusterKV.get(db, "test1")
end
end