Skip to content

Instantly share code, notes, and snippets.

@adaschevici
Created February 4, 2014 10:04
Show Gist options
  • Save adaschevici/8800958 to your computer and use it in GitHub Desktop.
Save adaschevici/8800958 to your computer and use it in GitHub Desktop.
shows 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
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