Open
Conversation
added 30 commits
February 21, 2017 15:19
added 17 commits
February 24, 2017 01:27
CheezItMan
reviewed
Feb 28, 2017
| @account.check_withdraw(200).must_equal 100 | ||
| end | ||
|
|
||
| it "Requires a positive withdrawal amount" do |
There was a problem hiding this comment.
This should instead be triggering an ArgumentError
| end | ||
|
|
||
|
|
||
| def check_withdraw(amount) |
There was a problem hiding this comment.
You should be able to call the withdraw method from within check_withdraw.
Bank AccountWhat We're Looking For
SummaryOverall nicely done, I put a few comments into the code here and there, but you did well. |
Author
|
Yay! Thanks Chris!
…On Tue, Feb 28, 2017 at 11:25 AM, Chris M ***@***.***> wrote:
***@***.**** commented on this pull request.
Overall nicely done, I put a few comments into the code here, but you did
well.
------------------------------
In specs/checking_account_spec.rb
<#31 (comment)>:
> end
it "Doesn't modify the balance if the account would go below -$10" do
- # TODO: Your test code here!
+ @account.check_withdraw(200).must_equal 100
end
it "Requires a positive withdrawal amount" do
This should instead be triggering an ArgumentError
------------------------------
In lib/checking.rb
<#31 (comment)>:
> + end
+
+
+ def withdraw(amount)
+
+ if @balance - (amount + 1) < 1
+ print "Insufficient Funds"
+ return @balnace = @balance
+ end
+ super
+ return @balance -= 1
+
+ end
+
+
+ def check_withdraw(amount)
You should be able to call the withdraw method from within check_withdraw.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATT5oohC13qUVnqr3Yu1rwaVyKnfnGC8ks5rhHSfgaJpZM4MMzzo>
.
|
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?raise ArgumentErroris some kind of conditional string method, that prints a message to the screen if specific criteria is or isn't met..all&.findmethods class methods? Why not instance methods?