Open
Conversation
…v works for everything but opendate
…draw in account class
…he big brother accounts class and tests are clean; using methods for minimum and fee
…les in savings account spec that need to be dealt with
Bank AccountWhat We're Looking For
SummaryOverall nicely done, the use of methods for fee, etc were a nice way to handle withdrawal using inheritance. You did have some things missing in your tests. Overall nicely done. |
CheezItMan
reviewed
Feb 28, 2017
CheezItMan
left a comment
There was a problem hiding this comment.
Nicely done overall, a few comments here and there.
|
|
||
|
|
||
| #method which returns 1, so fee for any object in checking account is now 1 | ||
| def fee |
There was a problem hiding this comment.
Interesting how you used this for the inheritance in Checking & Savings.
| raise ArgumentError.new("You need some positive cash flow to open an account") if balance < 0 | ||
| @id = id | ||
| @balance = balance | ||
| @opendate = opendate |
There was a problem hiding this comment.
a more standard name would be @open_date
| describe "CheckingAccount" do | ||
| describe "#initialize" do | ||
| # Check that a CheckingAccount is in fact a kind of account | ||
| it "Is a kind of Account" do |
|
|
||
| account = Bank::CheckingAccount.new(id, balance) | ||
| account.withdraw_using_check(amount) | ||
| account.balance.must_be :<, balance |
|
|
||
| it "Requires a positive withdrawal amount" do | ||
| # TODO: Your test code here! | ||
| id = 116 |
There was a problem hiding this comment.
Where's the attempt to do a negative withdrawal?
| amount = 10 | ||
|
|
||
| account = Bank::CheckingAccount.new(id, balance) | ||
| 4.times do account.withdraw_using_check(amount) end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bank Account
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError? What do you think it's doing?.all&.findmethods class methods? Why not instance methods?