Skip to content

Instantly share code, notes, and snippets.

@adaschevici
Created February 4, 2014 10:08
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 adaschevici/8801001 to your computer and use it in GitHub Desktop.
Save adaschevici/8801001 to your computer and use it in GitHub Desktop.
steps to reproduce #373
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
from lettuce import *
@before.each_scenario
def raiser(step):
pass
@after.each_scenario
def last_raiser(step):
raise Exception
# pass
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
@adaschevici
Copy link
Author

Console output:

0 feature (0 passed)
0 scenario (0 passed)
0 step (0 passed)

exit value:
echo $?
2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment