Skip to content

Commit

Permalink
Clear all geocoder cache between test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Nov 12, 2020
1 parent 2629661 commit 608abc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/geocoder_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
defmodule GeocoderTest do
use ExUnit.Case

setup do
# there's some state we need to clear before each test run
# https://github.com/sasa1977/con_cache/issues/11#issuecomment-116806567
:ok = Supervisor.terminate_child(Geocoder.Supervisor, Geocoder.Store)
{:ok, _} = Supervisor.restart_child(Geocoder.Supervisor, Geocoder.Store)
:ok
end

test "An address in New York" do
{:ok, coords} = Geocoder.call("1991 15th Street, Troy, NY 12180")
assert_new_york(coords)
Expand Down

0 comments on commit 608abc9

Please sign in to comment.