def test_multiple_subordinate_steps_are_run():
 @step('I run two subordinate steps')
 def two_subordinate_steps(step):
  step.behave_as('\n            When I run the first sub-step\n            And I run the second sub-step\n        ')
 global first_ran
 global second_ran
 first_ran = False
 second_ran = False
 @step('I run the first sub-step$')
 def increment(step):
  global first_ran
  first_ran = True
 @step('I run the second sub-step')
 def increment_twice(step):
  global second_ran
  second_ran = True
 runnable_step = Step.from_string('Given I run two subordinate steps')
 runnable_step.run(True)
 assert_equals((first_ran, second_ran), (True, True))
 del first_ran
 del second_ran

def test_multiple_subordinate_steps_are_run ( ) : @ step ( 'I run two subordinate steps' ) def two_subordinate_steps ( step ) : step . behave_as ( '\n            When I run the first sub-step\n            And I run the second sub-step\n        ' ) global first_ran global second_ran first_ran = False second_ran = False @ step ( 'I run the first sub-step$' ) def increment ( step ) : global first_ran first_ran = True @ step ( 'I run the second sub-step' ) def increment_twice ( step ) : global second_ran second_ran = True runnable_step = Step . from_string ( 'Given I run two subordinate steps' ) runnable_step . run ( True ) assert_equals ( ( first_ran , second_ran ) , ( True , True ) ) del first_ran del second_ran
when a step definition calls two subordinate step definitions .