Skip to content

Commit

Permalink
Downgrade Elixir version requirements and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed May 17, 2024
1 parent 92995b3 commit 6a537a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Confex.Mixfile do
description: description(),
package: package(),
version: @version,
elixir: "~> 1.10",
elixir: "~> 1.4",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [] ++ Mix.compilers(),
build_embedded: Mix.env() == :prod,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/confex/resolver_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule Confex.ResolverTest do

if Code.ensure_loaded?(Date.Range) do
test "resolves values with Date.Range" do
date_range = %Date.Range{}
date_range = Date.range(Date.utc_today(), Date.utc_today() |> Date.add(1))
assert Resolver.resolve(date_range) == {:ok, date_range}
assert Resolver.resolve(%{key: date_range}) == {:ok, %{key: date_range}}
assert Resolver.resolve(%{key: [date_range, date_range]}) == {:ok, %{key: [date_range, date_range]}}
Expand Down Expand Up @@ -103,7 +103,7 @@ defmodule Confex.ResolverTest do
list: [1, 2, 3],
tuple: {1, 2, 3},
map: %{key: [child: :value]},
charlist: 'foo'
charlist: ~c"foo"
]

assert Resolver.resolve(config) == {:ok, config}
Expand Down Expand Up @@ -222,8 +222,8 @@ defmodule Confex.ResolverTest do

test "for charlists" do
System.put_env("TESTENV", "abcde")
assert {:ok, 'abcde'} == Resolver.resolve({:system, :charlist, "TESTENV"})
assert {:ok, 'abcde'} == Resolver.resolve({:system, :charlist, "DOES_NOT_EXIST", 'abcde'})
assert {:ok, ~c"abcde"} == Resolver.resolve({:system, :charlist, "TESTENV"})
assert {:ok, ~c"abcde"} == Resolver.resolve({:system, :charlist, "DOES_NOT_EXIST", ~c"abcde"})

message = "can not resolve key DOES_NOT_EXIST value via adapter Elixir.Confex.Adapters.SystemEnvironment"
assert Resolver.resolve({:system, :charlist, "DOES_NOT_EXIST"}) == {:error, {:unresolved, message}}
Expand Down

0 comments on commit 6a537a9

Please sign in to comment.