Skip to content

Commit

Permalink
For tests, expected comes before actual (#1697)
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
kotp authored Jun 26, 2024
1 parent f070f9d commit ce05fcf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions exercises/practice/bank-account/bank_account_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_single_deposit
bank_account = BankAccount.new
bank_account.open
bank_account.deposit(100)
assert_equal bank_account.balance, 100
assert_equal 100, bank_account.balance
end

def test_multiple_deposits
Expand All @@ -23,7 +23,7 @@ def test_multiple_deposits
bank_account.open
bank_account.deposit(100)
bank_account.deposit(50)
assert_equal bank_account.balance, 150
assert_equal 150, bank_account.balance
end

def test_withdraw_once
Expand All @@ -32,7 +32,7 @@ def test_withdraw_once
bank_account.open
bank_account.deposit(100)
bank_account.withdraw(75)
assert_equal bank_account.balance, 25
assert_equal 25, bank_account.balance
end

def test_withdraw_twice
Expand All @@ -42,7 +42,7 @@ def test_withdraw_twice
bank_account.deposit(100)
bank_account.withdraw(80)
bank_account.withdraw(20)
assert_equal bank_account.balance, 0
assert_equal 0, bank_account.balance
end

def test_can_do_multiple_operations_sequentially
Expand All @@ -54,7 +54,7 @@ def test_can_do_multiple_operations_sequentially
bank_account.withdraw(200)
bank_account.deposit(60)
bank_account.withdraw(50)
assert_equal bank_account.balance, 20
assert_equal 20, bank_account.balance
end

def test_cannot_check_balance_of_closed_account
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_reopened_account_does_not_retain_balance
bank_account.deposit(50)
bank_account.close
bank_account.open
assert_equal bank_account.balance, 0
assert_equal 0, bank_account.balance
end

def test_cannot_withdraw_more_than_deposited
Expand Down

0 comments on commit ce05fcf

Please sign in to comment.