Skip to content

Commit 703bc66

Browse files
committed
fix: credo warning
1 parent 77acad4 commit 703bc66

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/forex/fetcher.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ defmodule Forex.Fetcher do
103103
Task.async(fn -> fetch_rates(:last_ninety_days_rates, opts) end)
104104
]
105105

106-
Task.await_many(tasks, 20000)
106+
Task.await_many(tasks, 20_000)
107107
|> Enum.all?(fn result -> match?({:ok, _}, result) end)
108108
|> case do
109109
true -> Logger.debug("Forex: Exchange rates updated!")

test/forex/feed_req_test.exs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
defmodule Forex.FeedReqTest do
22
use ExUnit.Case, async: true
33

4+
alias Forex.Feed.Req
5+
46
@moduletag :integration
57

68
@bad_feed_url "https://these-are-not-the-droids-you-are-looking-for.io"
79

810
describe "get_latest_rates/1" do
911
test "fetches the latest exchange rates from the European Central Bank (ECB)" do
10-
assert {:ok, body} = Forex.Feed.Req.get_latest_rates()
12+
assert {:ok, body} = Req.get_latest_rates()
1113
assert String.starts_with?(body, "<?xml version=")
1214
assert String.contains?(body, "<Cube currency='USD'")
1315

14-
assert {:error, _} = Forex.Feed.Req.get_latest_rates(url: @bad_feed_url)
16+
assert {:error, _} = Req.get_latest_rates(url: @bad_feed_url)
1517
end
1618
end
1719

1820
describe "get_last_ninety_days_rates/1" do
1921
test "fetches the exchange rates from the last ninety days from the ECB" do
20-
assert {:ok, body} = Forex.Feed.Req.get_last_ninety_days_rates()
22+
assert {:ok, body} = Req.get_last_ninety_days_rates()
2123
assert String.starts_with?(body, "<?xml version=")
2224
assert String.contains?(body, "<Cube currency=\"GBP\"")
2325

24-
assert {:error, _} = Forex.Feed.Req.get_last_ninety_days_rates(url: @bad_feed_url)
26+
assert {:error, _} = Req.get_last_ninety_days_rates(url: @bad_feed_url)
2527
end
2628
end
2729

2830
describe "get_historic_rates/1" do
2931
test "fetches the historic exchange rates feed from the ECB" do
30-
assert {:ok, body} = Forex.Feed.Req.get_historic_rates()
32+
assert {:ok, body} = Req.get_historic_rates()
3133
assert String.starts_with?(body, "<?xml version=")
3234
assert String.contains?(body, "<Cube currency=\"JPY\"")
3335

34-
assert {:error, _} = Forex.Feed.Req.get_historic_rates(url: @bad_feed_url)
36+
assert {:error, _} = Req.get_historic_rates(url: @bad_feed_url)
3537
end
3638
end
3739
end

0 commit comments

Comments
 (0)