1require File.dirname(__FILE__) + '/../story_helper'
2
3module Spec
4 module Story
5 module Runner
6 describe ScenarioCollector do
7 it 'should construct scenarios with the supplied story' do
8 # given
9 story = stub_everything('story')
10 scenario_collector = ScenarioCollector.new(story)
11
12 # when
13 scenario_collector.Scenario 'scenario1' do end
14 scenario_collector.Scenario 'scenario2' do end
15 scenarios = scenario_collector.scenarios
16
17 # then
18 scenario_collector.should have(2).scenarios
19 scenarios.first.name.should == 'scenario1'
20 scenarios.first.story.should equal(story)
21 scenarios.last.name.should == 'scenario2'
22 scenarios.last.story.should equal(story)
23 end
24 end
25 end
26 end
27end