Skip to content

Commit 2e1afe3

Browse files
committed
Refactor custom currency tests
1 parent f442a42 commit 2e1afe3

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

test/custom_currency_test.exs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
defmodule Money.CustomCurrencyTest do
22
use ExUnit.Case
33

4-
setup do
5-
Cldr.Currency.start_link()
6-
{:ok, _currency} = Cldr.Currency.new(:ABCD, name: "ABCD", digits: 0)
7-
:ok
8-
end
9-
104
test "Exchange rate conversion for a custom currency fails" do
115
m1 = Money.new(:ABCD, 10)
126

test/money_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ defmodule MoneyTest do
191191
end
192192

193193
test "creating a money struct with an invalid binary currency code returns error tuple" do
194-
assert Money.new("ABCD", 100) ==
195-
{:error, {Money.UnknownCurrencyError, "The currency \"ABCD\" is invalid"}}
194+
assert Money.new("XYZABC", 100) ==
195+
{:error, {Money.UnknownCurrencyError, "The currency \"XYZABC\" is invalid"}}
196196
end
197197

198198
test "string output of money is correctly formatted" do

test/test_helper.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
ExUnit.start()
2+
{:ok, _pid} = Cldr.Currency.start_link()
3+
{:ok, _currency} = Cldr.Currency.new(:ABCD, name: "ABCD", digits: 0)

0 commit comments

Comments
 (0)