Created
December 19, 2017 16:30
-
-
Save ramon-src/2c5b7713e847b9915c0c0a919b6b2d51 to your computer and use it in GitHub Desktop.
BDD example with RBehave
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
@given('the ninja has a {achievement_level}') | |
def step_the_ninja_has_a(context, achievement_level): | |
context.ninja_fight = NinjaFight(achievement_level) | |
@when('attacked by a {opponent_role}') | |
def step_attacked_by_a(context, opponent_role): | |
context.ninja_fight.opponent = opponent_role | |
@when('attacked by {opponent}') | |
def step_attacked_by(context, opponent): | |
context.ninja_fight.opponent = opponent | |
@then('the ninja should {reaction}') | |
def step_the_ninja_should(context, reaction): | |
assert_that(reaction, equal_to(context.ninja_fight.decision())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment