Created
December 30, 2009 22:48
-
-
Save rspec/266479 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: code-breaker submits guess | |
The code-breaker submits a guess of four numbers. The game marks the guess | |
with + and - signs. | |
For each number in the guess that matches the number and position of a number | |
in the secret code, the mark includes one +. For each number in the guess | |
that matches the number but not the position of a number in the secret code, | |
a - is added to the mark. | |
Scenario Outline: submit guess | |
Given the secret code is <code> | |
When I guess <guess> | |
Then the mark should be <mark> | |
Scenarios: all numbers correct | |
| code | guess | mark | | |
| 1234 | 1234 | ++++ | | |
| 1234 | 1243 | ++-- | | |
| 1234 | 1423 | +--- | | |
| 1234 | 4321 | ---- | | |
Scenarios: 3 numbers correct | |
| code | guess | mark | | |
| 1234 | 5234 | +++ | | |
| 1234 | 5134 | ++- | | |
| 1234 | 5124 | +-- | | |
| 1234 | 5123 | --- | | |
Scenarios: 2 numbers correct | |
| code | guess | mark | | |
| 1234 | 5254 | ++ | | |
| 1234 | 5154 | +- | | |
| 1234 | 2545 | -- | | |
Scenarios: 1 number correct | |
| code | guess | mark | | |
| 1234 | 1555 | + | | |
| 1234 | 5515 | - | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment