Skip to content

Instantly share code, notes, and snippets.

@gvisoc
Created February 6, 2017 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvisoc/b46a5eb7a5c390445a0608cb4bd43040 to your computer and use it in GitHub Desktop.
Save gvisoc/b46a5eb7a5c390445a0608cb4bd43040 to your computer and use it in GitHub Desktop.
An example on how to specify features using #Gherkin grammar. This is actually working part of the repo https://github.com/gvisoc/test-bdd-cucumber
Feature: non-overdraft account balance operations
In order to have a functional account
As a user
I want to be able to make deposits and withdraws
Scenario Outline: making deposits
Given an account with balance <bal>
When I make a deposit of <increment>
Then the account's balance should be <result>
Examples:
| bal | increment | result |
| 100 | 5.00 | 105 |
| 99 | 1234 | 1333 |
| 12 | 5.20 | 17.20 |
Scenario Outline: making withdraws
Given an account with balance <bal>
When I make a withdraw of <decrement>
Then the account's balance should be <result>
Examples:
| bal | decrement | result |
| 100.00 | 5 | 95 |
| 99 | 1234 | 99 |
| 12 | 5.95 | 6.05 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment