Skip to content

Commit

Permalink
chore(tests): remove key from test config (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekwong authored Jan 3, 2019
1 parent d974f3f commit e772c8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ Tests are written using [ExUnit](https://hexdocs.pm/ex_unit/ExUnit.html), Elixir

Here's how you can run the tests:

mix test
LOB_API_KEY=YOUR_TEST_API_KEY mix test

To run tests with a coverage report:

mix coveralls.html
LOB_API_KEY=YOUR_TEST_API_KEY mix coveralls.html

Then view the report at `cover/excoveralls.html`.

Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config

config :lob_elixir,
api_key: "test_5fae9e2d112690f0f8d534c5f9b4ad10257"
api_key: System.get_env("LOB_API_KEY")
5 changes: 5 additions & 0 deletions test/lob/client_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ defmodule Lob.ClientTest do
describe "api_key/1" do

test "raises MissingAPIKeyError if no API key is found" do

assert_raise(MissingAPIKeyError, fn ->
api_key = System.get_env("LOB_API_KEY")
System.delete_env("LOB_API_KEY")
Client.api_key(nil)
System.put_env("LOB_API_KEY", api_key)
end)

end

end
Expand Down

0 comments on commit e772c8e

Please sign in to comment.