Sha256: 6cfd71d311d4cbbcfd53159c216ae4bc065da6351075040e18d434ac002d33c1

Contents?: true

Size: 707 Bytes

Versions: 3

Compression:

Stored size: 707 Bytes

Contents

require File.dirname(__FILE__) + '/story_helper'

module Spec
  module Story
    describe GivenScenario do
      it 'should execute a scenario from the current story in its world' do
        # given
        class MyWorld
          attr :scenario_ran
        end
        instance = World.create(MyWorld)
        scenario = ScenarioBuilder.new.to_scenario do
          @scenario_ran = true
        end
        Runner::StoryRunner.should_receive(:scenario_from_current_story).with('scenario name').and_return(scenario)

        step = GivenScenario.new 'scenario name'

        # when
        step.perform(instance, nil)

        # then
        instance.scenario_ran.should be_true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.1.6 rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb
picolena-0.1.7 rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb
picolena-0.1.8 rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb