Created
November 7, 2014 15:23
-
-
Save jbpros/b489d9fb7c34abd2fbd7 to your computer and use it in GitHub Desktop.
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
Feature: deposit check | |
Why are we doing this? | |
Free text area. | |
Business rules: | |
* don't do evil | |
* be smart | |
Scenario Outline: successful deposits | |
Given I am a customer | |
And I have <initial_balance> on my account | |
When I deposit a <check_amount> check to my account | |
Then I should get <final_balance> on my account | |
Examples: | |
| initial_balance | check_amount | final_balance | | |
| 0 | 120 | 120 | | |
| 1000 | 34 | 1034 | | |
| 65 | 2 | 67 | | |
| 65 | 2 | 167 | |
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
Given(/^I am a customer$/) do | |
end | |
Given(/^I have (\d+) on my account$/) do |initial_balance| | |
@balance = initial_balance.to_i | |
end | |
When(/^I deposit a (\d+) check to my account$/) do |check_amount| | |
@balance = @balance + check_amount.to_i | |
end | |
Then(/^I should get (\d+) on my account$/) do |expected_balance| | |
if expected_balance.to_i != @balance | |
raise "Current balance is #{@balance}, expected #{expected_balance}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment