diff options
Diffstat (limited to 'test/exdatadog/config_test.exs')
-rw-r--r-- | test/exdatadog/config_test.exs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/exdatadog/config_test.exs b/test/exdatadog/config_test.exs new file mode 100644 index 0000000..2be0c38 --- /dev/null +++ b/test/exdatadog/config_test.exs @@ -0,0 +1,30 @@ +defmodule Exdatadog.Config.Test do + @moduledoc """ + Provides tests for Exdatadog.Config + """ + use ExUnit.Case + + import Exdatadog.Config + + setup_all do + System.put_env("TEST_VAR", "BAR") + Application.put_env(:test_app, :test_key, {:system, "TEST_VAR"}) + Application.put_env(:test_app, :test_foo, "FOO") + + on_exit fn -> + System.delete_env("TEST_VAR") + Application.delete_env(:test_app, :test_key) + Application.delete_env(:test_app, :test_foo) + end + + end + + test "can read variable from application settings" do + assert get_env_var(:test_app, :test_foo) == "FOO" + end + + test "can read environment variables for settings" do + assert get_env_var(:test_app, :test_key) == "BAR" + end + +end |