]> Entropealabs - cluster_kv.git/commitdiff
runs a test
authorChristopher <chris@entropealabs.com>
Mon, 16 Mar 2020 02:34:00 +0000 (21:34 -0500)
committerChristopher <chris@entropealabs.com>
Mon, 16 Mar 2020 02:34:00 +0000 (21:34 -0500)
test/cluster_kv_test.exs

index 431dddf6eaa2456dbe35b843d4dc13aecdd55614..a08e5787631ed26f2a193bc86ffc6ad909e0355a 100644 (file)
@@ -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