Created
February 4, 2014 10:08
-
-
Save adaschevici/8801001 to your computer and use it in GitHub Desktop.
steps to reproduce #373
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
from lettuce import * | |
@step('I have the number (\d+)') | |
def have_the_number(step, number): | |
world.number = int(number) | |
@step('I compute its factorial') | |
def compute_its_fatorial(step): | |
world.number = factorial(world.number) | |
@step('I see the number (\d+)') | |
def check_number(step, expected): | |
expected = int(expected) | |
assert world.number == expected, \ | |
"Got %d" % world.number | |
def factorial(number): | |
return 1 | |
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
from lettuce import * | |
@before.each_scenario | |
def raiser(step): | |
pass | |
@after.each_scenario | |
def last_raiser(step): | |
raise Exception | |
# pass |
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: Compute factorial | |
In order to play with Lettuce As beginners We’ll implement factorial | |
Scenario: Factorial of 0 | |
Given I have the number 0 | |
When I compute its factorial | |
Then I see the number 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console output:
0 feature (0 passed)
0 scenario (0 passed)
0 step (0 passed)
exit value:
echo $?
2