Skip to content

Commit ce05fcf

Browse files
authored
For tests, expected comes before actual (#1697)
[no important files changed]
1 parent f070f9d commit ce05fcf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

exercises/practice/bank-account/bank_account_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_single_deposit
1414
bank_account = BankAccount.new
1515
bank_account.open
1616
bank_account.deposit(100)
17-
assert_equal bank_account.balance, 100
17+
assert_equal 100, bank_account.balance
1818
end
1919

2020
def test_multiple_deposits
@@ -23,7 +23,7 @@ def test_multiple_deposits
2323
bank_account.open
2424
bank_account.deposit(100)
2525
bank_account.deposit(50)
26-
assert_equal bank_account.balance, 150
26+
assert_equal 150, bank_account.balance
2727
end
2828

2929
def test_withdraw_once
@@ -32,7 +32,7 @@ def test_withdraw_once
3232
bank_account.open
3333
bank_account.deposit(100)
3434
bank_account.withdraw(75)
35-
assert_equal bank_account.balance, 25
35+
assert_equal 25, bank_account.balance
3636
end
3737

3838
def test_withdraw_twice
@@ -42,7 +42,7 @@ def test_withdraw_twice
4242
bank_account.deposit(100)
4343
bank_account.withdraw(80)
4444
bank_account.withdraw(20)
45-
assert_equal bank_account.balance, 0
45+
assert_equal 0, bank_account.balance
4646
end
4747

4848
def test_can_do_multiple_operations_sequentially
@@ -54,7 +54,7 @@ def test_can_do_multiple_operations_sequentially
5454
bank_account.withdraw(200)
5555
bank_account.deposit(60)
5656
bank_account.withdraw(50)
57-
assert_equal bank_account.balance, 20
57+
assert_equal 20, bank_account.balance
5858
end
5959

6060
def test_cannot_check_balance_of_closed_account
@@ -107,7 +107,7 @@ def test_reopened_account_does_not_retain_balance
107107
bank_account.deposit(50)
108108
bank_account.close
109109
bank_account.open
110-
assert_equal bank_account.balance, 0
110+
assert_equal 0, bank_account.balance
111111
end
112112

113113
def test_cannot_withdraw_more_than_deposited

0 commit comments

Comments
 (0)