@with_setup(step_runner_environ)
def test_step_definitions_takes_the_step_object_as_first_argument():
 FEATURE = '\n    Feature: Steps as args\n        Scenario: Steps as args\n            When I define this one\n    '
 @step('When I define this one')
 def when_i_define_this_one(step):
  assert_equals(step.sentence, 'When I define this one')
 f = Feature.from_string(FEATURE)
 feature_result = f.run()
 scenario_result = feature_result.scenario_results[0]
 assert_equals(len(scenario_result.steps_passed), 1)
 assert_equals(scenario_result.total_steps, 1)

@ with_setup ( step_runner_environ ) def test_step_definitions_takes_the_step_object_as_first_argument ( ) : FEATURE = '\n    Feature: Steps as args\n        Scenario: Steps as args\n            When I define this one\n    ' @ step ( 'When I define this one' ) def when_i_define_this_one ( step ) : assert_equals ( step . sentence , 'When I define this one' ) f = Feature . from_string ( FEATURE ) feature_result = f . run ( ) scenario_result = feature_result . scenario_results [ 0 ] assert_equals ( len ( scenario_result . steps_passed ) , 1 ) assert_equals ( scenario_result . total_steps , 1 )
step definitions takes step object as first argument .