diff --git a/config/test.exs b/config/test.exs index 3bf3941..7ec48dd 100644 --- a/config/test.exs +++ b/config/test.exs @@ -3,4 +3,6 @@ import Config config :logger, level: :error config :peridiod_persistence, - kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: %{"peridio_disk_devpath" => "/dev/mmcblk1"}} + kv_backend: + {PeridiodPersistence.KVBackend.InMemory, + contents: %{"peridio_disk_devpath" => "/dev/mmcblk1"}} diff --git a/lib/peridiod_persistence.ex b/lib/peridiod_persistence.ex index 5a7a603..9964306 100644 --- a/lib/peridiod_persistence.ex +++ b/lib/peridiod_persistence.ex @@ -1,3 +1,3 @@ defmodule PeridiodPersistence do -@moduledoc false + @moduledoc false end diff --git a/lib/peridiod_persistence/application.ex b/lib/peridiod_persistence/application.ex index 328f581..8955fe3 100644 --- a/lib/peridiod_persistence/application.ex +++ b/lib/peridiod_persistence/application.ex @@ -10,6 +10,7 @@ defmodule PeridiodPersistence.Application do @impl true def start(_type, _args) do application_config = Application.get_all_env(:peridiod_persistence) + children = [ {KV, application_config} ] diff --git a/mix.exs b/mix.exs index c2deddb..9a82de2 100644 --- a/mix.exs +++ b/mix.exs @@ -22,7 +22,7 @@ defmodule PeridiodPersistence.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:uboot_env, "~> 1.0"}, + {:uboot_env, "~> 1.0"} ] end end diff --git a/test/kv_test.exs b/test/kv_test.exs index c5c238f..40949ac 100644 --- a/test/kv_test.exs +++ b/test/kv_test.exs @@ -14,7 +14,8 @@ defmodule PeridiodPersistence.KVTest do setup context do options = - context[:kv_options] || [kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: @kv}] + context[:kv_options] || + [kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: @kv}] {:ok, kv_pid} = KV.start_link(options, []) KV.get_all(kv_pid) @@ -52,7 +53,12 @@ defmodule PeridiodPersistence.KVTest do end test "put/1", context do - assert :ok = KV.put_map(context.kv_pid, %{"test_key1" => "test_value1", "test_key2" => "test_value2"}) + assert :ok = + KV.put_map(context.kv_pid, %{ + "test_key1" => "test_value1", + "test_key2" => "test_value2" + }) + assert KV.get(context.kv_pid, "test_key1") == "test_value1" assert KV.get(context.kv_pid, "test_key2") == "test_value2" end @@ -73,7 +79,9 @@ defmodule PeridiodPersistence.KVTest do assert KV.get_active(context.kv_pid, "active_test_key2") == "active_test_value2" end - @tag kv_options: [kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: %{"key" => "value"}}] + @tag kv_options: [ + kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: %{"key" => "value"}} + ] test "old modules configuration", context do assert KV.get(context.kv_pid, "key") == "value" @@ -81,7 +89,9 @@ defmodule PeridiodPersistence.KVTest do assert KV.get(context.kv_pid, "test_key") == "test_value" end - @tag kv_options: [kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: %{"key" => "value"}}] + @tag kv_options: [ + kv_backend: {PeridiodPersistence.KVBackend.InMemory, contents: %{"key" => "value"}} + ] test "old configuration", context do assert KV.get(context.kv_pid, "key") == "value" diff --git a/test/peridiod_persistence_test.exs b/test/peridiod_persistence_test.exs index d7a6619..01969ba 100644 --- a/test/peridiod_persistence_test.exs +++ b/test/peridiod_persistence_test.exs @@ -1,5 +1,4 @@ defmodule PeridiodPersistenceTest do use ExUnit.Case doctest PeridiodPersistence - end