From: Christopher Date: Mon, 16 Mar 2020 02:34:00 +0000 (-0500) Subject: runs a test X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=9904fecc581507172c616f066349338355007aa9;p=cluster_kv.git runs a test --- diff --git a/test/cluster_kv_test.exs b/test/cluster_kv_test.exs index 431dddf..a08e578 100644 --- a/test/cluster_kv_test.exs +++ b/test/cluster_kv_test.exs @@ -1,8 +1,22 @@ -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