File tree Expand file tree Collapse file tree 3 files changed +211
-58
lines changed
Expand file tree Collapse file tree 3 files changed +211
-58
lines changed Original file line number Diff line number Diff line change @@ -38,19 +38,25 @@ defmodule Numscriptex.BalanceTest do
3838 account: "bar" ,
3939 asset: "USD/2" ,
4040 final_balance: 50 ,
41- initial_balance: 0
41+ decimal_final_balance: 0.5 ,
42+ initial_balance: 0 ,
43+ decimal_initial_balance: 0.0
4244 } ,
4345 % Numscriptex.Balance {
4446 account: "baz" ,
4547 asset: "USD/2" ,
4648 final_balance: 49 ,
47- initial_balance: 0
49+ decimal_final_balance: 0.49 ,
50+ initial_balance: 0 ,
51+ decimal_initial_balance: 0.0
4852 } ,
4953 % Numscriptex.Balance {
5054 account: "foo" ,
5155 asset: "USD/2" ,
5256 final_balance: 1 ,
53- initial_balance: 100
57+ initial_balance: 100 ,
58+ decimal_final_balance: 0.01 ,
59+ decimal_initial_balance: 1.0
5460 }
5561 ]
5662
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ defmodule Numscriptex.PostingTest do
66 doctest Numscriptex.Posting
77
88 describe "from_map/1" do
9- setup_all do
9+ setup do
1010 postings = [
1111 % {
1212 amount: 100 ,
@@ -18,7 +18,7 @@ defmodule Numscriptex.PostingTest do
1818 amount: 100 ,
1919 asset: "USD/2" ,
2020 destination: "baz" ,
21- source: "foo "
21+ source: "bar "
2222 }
2323 ]
2424
@@ -31,12 +31,14 @@ defmodule Numscriptex.PostingTest do
3131 assert postings == [
3232 % Numscriptex.Posting {
3333 amount: 100 ,
34+ decimal_amount: 1.0 ,
3435 asset: "USD/2" ,
3536 destination: "bar" ,
3637 source: "foo"
3738 } ,
3839 % Numscriptex.Posting {
3940 amount: 100 ,
41+ decimal_amount: 1.0 ,
4042 asset: "USD/2" ,
4143 destination: "baz" ,
4244 source: "bar"
@@ -49,6 +51,7 @@ defmodule Numscriptex.PostingTest do
4951
5052 assert posting == % Numscriptex.Posting {
5153 amount: 100 ,
54+ decimal_amount: 1.0 ,
5255 asset: "USD/2" ,
5356 destination: "bar" ,
5457 source: "foo"
You can’t perform that action at this time.
0 commit comments