Created
November 22, 2010 08:18
-
-
Save msassak/709666 to your computer and use it in GitHub Desktop.
The Gherkin Builder API
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
| require 'gherkin' | |
| require 'gherkin/builder' | |
| gherkin = Gherkin::Builder.new do | |
| feature "Addition" do | |
| description "In order to avoid silly mistakes..." | |
| scenario_outline "Add two numbers" do | |
| step :given, "I have entered <input_1> into the calculator" | |
| step :and, "I have entered <input_2> into the calculator" | |
| step :when, "I press <button>" | |
| step :then, "the result should be <output> on the screen" | |
| examples "Needs a default" do | |
| row ["input_1", "input_2", "button", "output"] | |
| row ["20", "30", "add", "50"] | |
| row ["2", "5", "add", "7"] | |
| row ["0", "40", "add", "40"] | |
| end | |
| end | |
| end | |
| end | |
| puts gherkin.to_gherkin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment