Closed Adzz closed 5 years ago
Hello, @Adzz! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.
Hey @Adzz. The test won't work after your fix because we are using doctests and they are sensitive for additional spaces. I'm pretty sure there is magical fix for this (like using some sigil for doc comment), but not sure which one to use. If you can find a way to fix this - it would be awesome :).
Ah good point!
@AndrewDryga I can see two simple solutions, which do you prefer?
@error_message """
can not resolve key MY_TEST_ENV value via adapter Elixir.Confex.Adapters.SystemEnvironment
"""
# ... more code
"""
iex> :ok = System.delete_env("MY_TEST_ENV")
...> Application.put_env(:myapp, :test_var, {:system, :integer, "MY_TEST_ENV"})
...> #{__MODULE__}.fetch_env!(:myapp, :test_var)
** (ArgumentError) can't fetch value for key `:test_var` of application `:myapp`, #{@error_message}
"""
The other option is to sack of doctests, and use normal tests, but I imagine that's a no!
Sigils wont work. ~S"""
means the string wont let you use escape codes, which means we can't escape a new line, which means we have to have one long line anyway.
Let's leave it in on long line then
should fix this: