Skip to content

Commit

Permalink
Sync ledger (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska authored Jan 7, 2024
1 parent 1bc2768 commit df646c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions exercises/practice/ledger/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ description = "credit and debit"

[502c4106-0371-4e7c-a7d8-9ce33f16ccb1]
description = "multiple entries on same date ordered by description"
include = false

[29dd3659-6c2d-4380-94a8-6d96086e28e1]
description = "final order tie breaker is change"
Expand All @@ -41,3 +42,7 @@ description = "Dutch negative number with 3 digits before decimal point"

[29670d1c-56be-492a-9c5e-427e4b766309]
description = "American negative number with 3 digits before decimal point"

[9c70709f-cbbd-4b3b-b367-81d7c6101de4]
description = "multiple entries on same date ordered by description"
reimplements = "502c4106-0371-4e7c-a7d8-9ce33f16ccb1"
4 changes: 2 additions & 2 deletions exercises/practice/ledger/test/ledger_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ defmodule LedgerTest do
@tag :pending
test "multiple entries on same date ordered by description" do
entries = [
%{amount_in_cents: 1000, date: ~D[2015-01-02], description: "Get present"},
%{amount_in_cents: 1000, date: ~D[2015-01-01], description: "Get present"},
%{amount_in_cents: -1000, date: ~D[2015-01-01], description: "Buy present"}
]

assert Ledger.format_entries(:usd, :en_US, entries) ==
"""
Date | Description | Change\s\s\s\s\s\s\s
01/01/2015 | Buy present | ($10.00)
01/02/2015 | Get present | $10.00\s
01/01/2015 | Get present | $10.00\s
"""
end

Expand Down

0 comments on commit df646c4

Please sign in to comment.