Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Janice's Bank Accounts. At long last. #48

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6c66f0f
Account#initialize test passed.
janicewilson Feb 21, 2017
d352739
Raises an ArgumentError when created with a negative balance test pas…
janicewilson Feb 21, 2017
5164162
Can be created with a balance of 0 test passed.
janicewilson Feb 21, 2017
aa0734e
Account#withdraw test passed.
janicewilson Feb 21, 2017
6c6aa1c
"Returns the modified balance" and "Outputs a warning if the account …
janicewilson Feb 21, 2017
8b63bb6
"Allows the balance to go to 0" and "Requires a positive withdrawal a…
janicewilson Feb 22, 2017
b80a9c3
"Requires a positive withdrawal amount" test passes.
janicewilson Feb 22, 2017
78f2f94
"Increases the balance", "Returns the modified balance" and "Requires…
janicewilson Feb 22, 2017
44535b0
Added the optional. Attempted to add a "before" statement, but too ti…
janicewilson Feb 22, 2017
75faf68
Reboot re Wave 1. Committing without regrets.
janicewilson Feb 23, 2017
e3ffbb8
YAR (Yet Another Reboot.)
janicewilson Feb 23, 2017
3cc028d
All tests but the last have passed.
janicewilson Feb 24, 2017
85e624e
All tests but the last have passed.
janicewilson Feb 24, 2017
f69fa40
A fully sanitized Wave 2.
janicewilson Feb 24, 2017
f530f7b
Minitests for Savings Account \'initialize\' and \'withdraw\' success…
janicewilson Feb 24, 2017
16d4639
Added RB files for savings and checking account..
janicewilson Feb 24, 2017
fe911d4
Minitest /'add_interest/' passed for Saving Account.
janicewilson Feb 24, 2017
396ed54
Minitests re \'initialize\' and \'withdraw'\ updated.
janicewilson Feb 25, 2017
502cc28
Minitests re \'initialize\' and \'withdraw'\ updated.
janicewilson Feb 25, 2017
c26a9ed
All systems go. All mini-tests passed.
janicewilson Feb 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minitests re \'initialize\' and \'withdraw'\ updated.
janicewilson committed Feb 25, 2017
commit 502cc28629d808cf0b8429c2118b7f49b8c716f2
8 changes: 6 additions & 2 deletions lib/checking_account.rb
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ class CheckingAccount < Account
def withdraw(withdrawal_amount)

raise ArgumentError.new "Please enter a withdrawal amount greater than 0." unless withdrawal_amount > 0
withdrawal_fee = 1

withdrawal_fee = 0

if @balance >= withdrawal_amount + withdrawal_fee
@balance -= (withdrawal_amount + withdrawal_fee)
@@ -22,6 +22,10 @@ def withdraw(withdrawal_amount)

end

def withdraw(withdrawal_amount)

end



end
14 changes: 12 additions & 2 deletions specs/checking_account_spec.rb
Original file line number Diff line number Diff line change
@@ -46,11 +46,21 @@

describe "#withdraw_using_check" do
it "Reduces the balance" do
# TODO: Your test code here!

start_balance = 300
withdrawal_amount = 100
withdrawal_fee = 0
account = Bank::CheckingAccount.new(12345, start_balance)
account.withdraw_using_check(withdrawal_amount)

account.withdraw(withdrawal_amount).must_equal start_balance - (withdrawal_amount + withdrawal_fee)

end

xit "Returns the modified balance" do
# TODO: Your test code here!

account.withdraw(withdrawal_amount).must_equal

end

xit "Allows the balance to go down to -$10" do