def test_scenario_has_steps():
 scenario = Scenario.from_string(SCENARIO1)
 assert_equals(type(scenario.steps), list)
 assert_equals(len(scenario.steps), 4, 'It should have 4 steps')
 expected_sentences = ['Given I have the following courses in my university:', "When I consolidate the database into 'courses.txt'", "Then I see the 1st line of 'courses.txt' has 'Computer Science:5'", "And I see the 2nd line of 'courses.txt' has 'Nutrition:4'"]
 for (step, expected_sentence) in zip(scenario.steps, expected_sentences):
  assert_equals(type(step), Step)
  assert_equals(step.sentence, expected_sentence)
 assert_equals(scenario.steps[0].keys, ('Name', 'Duration'))
 assert_equals(scenario.steps[0].hashes, [{'Name': 'Computer Science', 'Duration': '5 years'}, {'Name': 'Nutrition', 'Duration': '4 years'}])

def test_scenario_has_steps ( ) : scenario = Scenario . from_string ( SCENARIO1 ) assert_equals ( type ( scenario . steps ) , list ) assert_equals ( len ( scenario . steps ) , 4 , 'It should have 4 steps' ) expected_sentences = [ 'Given I have the following courses in my university:' , "When I consolidate the database into 'courses.txt'" , "Then I see the 1st line of 'courses.txt' has 'Computer Science:5'" , "And I see the 2nd line of 'courses.txt' has 'Nutrition:4'" ] for ( step , expected_sentence ) in zip ( scenario . steps , expected_sentences ) : assert_equals ( type ( step ) , Step ) assert_equals ( step . sentence , expected_sentence ) assert_equals ( scenario . steps [ 0 ] . keys , ( 'Name' , 'Duration' ) ) assert_equals ( scenario . steps [ 0 ] . hashes , [ { 'Name' : 'Computer Science' , 'Duration' : '5 years' } , { 'Name' : 'Nutrition' , 'Duration' : '4 years' } ] )
a scenario object should have a list of steps .