Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed Jul 26, 2024
1 parent 7b98ee1 commit d831b0f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
2 changes: 1 addition & 1 deletion lib/peridiod_persistence.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
defmodule PeridiodPersistence do
@moduledoc false
@moduledoc false
end
1 change: 1 addition & 0 deletions lib/peridiod_persistence/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 14 additions & 4 deletions test/kv_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -73,15 +79,19 @@ 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"

assert :ok = KV.put(context.kv_pid, "test_key", "test_value")
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"

Expand Down
1 change: 0 additions & 1 deletion test/peridiod_persistence_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
defmodule PeridiodPersistenceTest do
use ExUnit.Case
doctest PeridiodPersistence

end

0 comments on commit d831b0f

Please sign in to comment.