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

Alison's Bank Accounts #47

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b092c16
sets up initial structure of module and class
AlisonZ Feb 22, 2017
a7faa32
adds show balance method and verifies that new objects are being inst…
AlisonZ Feb 22, 2017
8f64dba
working withdraw method, needs to be tested with spec file
AlisonZ Feb 22, 2017
9d1ca5b
withdraw method works and passes tests
AlisonZ Feb 22, 2017
5d96b68
deposit feature working and passes tests
AlisonZ Feb 22, 2017
66f4bf0
adds error for negative starting balances and all tests for Wave 1 ar…
AlisonZ Feb 22, 2017
546ff3b
phase one features are working
AlisonZ Feb 23, 2017
87df7fe
phase one is working and passes all tests
AlisonZ Feb 23, 2017
1131b7a
code and tests for self.all are working thanks to chris video
AlisonZ Feb 23, 2017
ae34958
find tests for verifying an account and that the first matches the cs…
AlisonZ Feb 23, 2017
d24e5e5
wave one working except for open dates
AlisonZ Feb 24, 2017
d9f47c4
there is a new class savings that inherits from account and passes th…
AlisonZ Feb 24, 2017
440ea50
holy cow the initialize works and i just wrote a test before code and…
AlisonZ Feb 24, 2017
e84065a
transaction fee is working and the test is all green
AlisonZ Feb 24, 2017
8184e59
withdraw fee tests and code works
AlisonZ Feb 24, 2017
339a8ca
not letting withdraws happen if fee would put account under 10; tests…
AlisonZ Feb 24, 2017
9030ecf
holy cow all of the tests and code for savings account work
AlisonZ Feb 24, 2017
cac59ee
savings account interest is being tracked and tests all work.
AlisonZ Feb 24, 2017
102fed7
changed interest to a local variable, tests still pass, savings accou…
AlisonZ Feb 24, 2017
e27d6b0
tests and code working for initializing and fee for withdraw method
AlisonZ Feb 24, 2017
b736ce5
trying to make variables of minimum and fee to share the load of with…
AlisonZ Feb 24, 2017
4fcfd35
woohooooooo savings and checking withdraw are inheriting stuff from t…
AlisonZ Feb 24, 2017
dbfd30d
withdraw tests all done for checking working
AlisonZ Feb 24, 2017
cb2b142
test for withdraw using check working and new balance is being returned
AlisonZ Feb 24, 2017
5008cf3
does not allow to go below -10
AlisonZ Feb 24, 2017
3994ad1
doesn't allow to withdraw below -10 and requires a positive withdraw …
AlisonZ Feb 24, 2017
760dae0
allows three free checks; there are some warnings about unused variab…
AlisonZ Feb 24, 2017
3417c20
withdraw_using_checks method is a go
AlisonZ Feb 24, 2017
88bacf4
reset checks method working
AlisonZ Feb 24, 2017
221f959
all working, no errors.
AlisonZ Feb 24, 2017
744f595
adds final forgotten test in savings spec. baseline is finished and e…
AlisonZ Feb 24, 2017
664da91
managed merge conflict
AlisonZ Feb 24, 2017
61f6739
submittinh hwk
AlisonZ Feb 27, 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
reset checks method working
AlisonZ committed Feb 24, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 88bacf46d459f0c61dd5c3524ba976946131dbf6
24 changes: 3 additions & 21 deletions lib/checking_account.rb
Original file line number Diff line number Diff line change
@@ -42,27 +42,9 @@ def withdraw_using_check(amount)
end




















# def reset_checks
#
# end
def reset_checks
@check_counter = 0
end
end

end
35 changes: 27 additions & 8 deletions specs/checking_account_spec.rb
Original file line number Diff line number Diff line change
@@ -134,22 +134,41 @@
end


describe "#reset_checks" do
it "Can be called without error" do
id = 116
balance = 100

account = Bank::CheckingAccount.new(id, balance)
account.reset_checks
end
end


it "Makes the next three checks free if less than 3 checks had been used" do
id = 116
balance = 100
amount = 10

account = Bank::CheckingAccount.new(id, balance)
account.withdraw_using_check(amount)
account.reset_checks

describe "#reset_checks" do
it "Can be called without error" do
# TODO: Your test code here!
3.times do account.withdraw_using_check(amount)end
account.balance.must_equal (balance - (4 * amount))
end

it "Makes the next three checks free if less than 3 checks had been used" do
# TODO: Your test code here!
end

it "Makes the next three checks free if more than 3 checks had been used" do
# TODO: Your test code here!
id = 116
balance = 100
amount = 10

account = Bank::CheckingAccount.new(id, balance)
5.times do account.withdraw_using_check(amount)end
account.reset_checks
account.withdraw_using_check(amount)
# account.balance.must_equal 36
account.balance.must_equal ((balance - (6 * amount)) - 4)
end
end
end
2 changes: 1 addition & 1 deletion specs/savings_account_spec.rb
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@




#WHOOPS NEED TO FINISH THIS!!!
it "Requires a positive rate" do
# TODO: Your test code here!
end