From 6a537a955363d765209b3a2dec200daa9ffd2cf7 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Fri, 17 May 2024 13:16:55 -0600 Subject: [PATCH] Downgrade Elixir version requirements and fix tests --- mix.exs | 2 +- test/unit/confex/resolver_test.exs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mix.exs b/mix.exs index 2d43267..faba655 100644 --- a/mix.exs +++ b/mix.exs @@ -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, diff --git a/test/unit/confex/resolver_test.exs b/test/unit/confex/resolver_test.exs index 8bfe9c3..5aa958c 100644 --- a/test/unit/confex/resolver_test.exs +++ b/test/unit/confex/resolver_test.exs @@ -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]}} @@ -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} @@ -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}}