-
Notifications
You must be signed in to change notification settings - Fork 65
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
atm_challenge_2020 by Sara & Sebastian #25
Open
SaraFrantzen
wants to merge
35
commits into
CraftAcademy:master
Choose a base branch
from
SaraFrantzen:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+514
−0
Conversation
This file contains 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
…. Installing bundler. Adding source and gem to Gemfile. Created .gitignore file to include .DS_store
…us work see repo 'https://github.com/Saralundkvist86/atm.git'. Greates atm_spec.rb and also adding all code from previous work. See same repo
…tm.rb. Creating a method for account_disabled and adding another argument account_status. Creating a when sending a message to the user 'account status is disabled'.
…searchpath for account.account_status in when account_disabled?. Running Rspec, all 7 tests passes
… 'allow withdraw if the account has enough balance.
…nt_status, :exp_date and :account_owner in new file lib/ account.rb. Creates a test in new file spec/account_spec.rb 'check that pincode has 4 digits', test passes
…ding STANDARD_VALIDITY_YRS on account.rb
…Date.today, using method as argument for @exp_date. Test 'Account is expected to have an expiry date on initialize' now passes
…dding in new method self.deactivate(account). Test passes
…ute of name. creates test 'is expected to have an owner'. In account.rb :account_owner is initialized. Test passes. @account_owner = set_owner(attr[:owner]), set_owner(obj) are defined with a Ternary Operator obj == nil ? missing_owner : @owner = obj, meaning that missing_owner should be executed when obj=nil. Method is defined to missing_owner to raise errormessage if no owner is set. 'is expected to throw error if no owner is set' test is created in account_spec.rb but FAILS
…owner is set', test didnt pass as the errormessage didnt match the errormessage defined in raise for function missing_owner in account.rb. all tests passes for account_spec.rb
…e, :cash, :account. defining method set_name with turnery operator which will go to missing_name when name is set to nil, otherwise new name will belong to person. Creating ./spec/person_spec.rb with test 'is expected to have a :name on initialize'. Test passes
…. Creating test 'is expected to raise an error if no name is set'. Test passes.
…e. Creating a test 'is expected to have a :cash attribute with the value of 0 on initialize'. Test passes
…eating a test 'is expected to have a :account attribute'. Test passes.
…ss to belong to the Account class. Creating test 'Person of account class. test pass
…on with himself as an owner to confirm that new accounts will belong to the person creating it. Test passes
…== nil the function missing_account schould be executed, otherwise deposit_funds method will go on to make it possible to make a deposit as a user. Missing_account method is created to raise error messege telling user that no account is present. Deposit_funds(amount) method is created with attributes of @cash and @account.balance to eq the origin amount + deposit. 2test are created to execute these functions. 1. 'Person can deposit funds if account has been created' and 2. 'person can\'t deposit funds when no account has been created' Both test passes
…om cash'. Test passes as all instances are already described
…ng block { subject.withdraw(amount: 100, pin: subject.account.pincode, account: subject.account, atm: atm) } expecting lambda to be truthy when calling. Creating function 'withdraw_funds' and 'increase_cash' contain expected lambda output as in the test. Test passes.
…ayby just by sliding the creditcard randomly in the air .. an errormessage should be thrown that 'An ATM is required'. Creating method missing_atm to be able to show that RuntimeError. Creating test 'Person withdraw is expected to raise an error if no ATM is passed in' Test passes
… balance' to ensure everything works correctly. Test passes
…ents on README file 'Starting with 500'.
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.
No description provided.