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
Next Next commit
Account#initialize test passed.
janicewilson committed Feb 21, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6c66f0f5a3a79a6d7ee77c09cff199b14d2b205c
15 changes: 15 additions & 0 deletions lib/account.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Bank

class Account

attr_accessor :id, :balance

def initialize(id, balance)

@id = id
@balance = balance

end
end

end
10 changes: 6 additions & 4 deletions specs/account_spec.rb
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
require 'minitest/skip_dsl'
require_relative '../lib/account'

Minitest::Reporters.use!

describe "Wave 1" do
describe "Account#initialize" do
it "Takes an ID and an initial balance" do
@@ -17,7 +19,7 @@
account.balance.must_equal balance
end

it "Raises an ArgumentError when created with a negative balance" do
xit "Raises an ArgumentError when created with a negative balance" do
# Note: we haven't talked about procs yet. You can think
# of them like blocks that sit by themselves.
# This code checks that, when the proc is executed, it
@@ -27,13 +29,13 @@
}.must_raise ArgumentError
end

it "Can be created with a balance of 0" do
xit "Can be created with a balance of 0" do
# If this raises, the test will fail. No 'must's needed!
Bank::Account.new(1337, 0)
end
end

describe "Account#withdraw" do
xdescribe "Account#withdraw" do
it "Reduces the balance" do
start_balance = 100.0
withdrawal_amount = 25.0
@@ -101,7 +103,7 @@
end
end

describe "Account#deposit" do
xdescribe "Account#deposit" do
it "Increases the balance" do
start_balance = 100.0
deposit_amount = 25.0