Sha256: 3b580ef41120d3b60cc7a0969bc3e87d04596c0583e2234ede54c722062a0026

Contents?: true

Size: 1.39 KB

Versions: 17

Compression:

Stored size: 1.39 KB

Contents

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

module Cucumber
  module Tree
    describe ScenarioOutline do

      def mock_feature
         mock_feature = mock("feature")
      end

      def mock_scenario(stubs ={})
        mock("scenario", {:update_table_column_widths => nil}.merge(stubs))
      end

      it "should indicate its a scenario outline" do
        scenario_outline = ScenarioOutline.new(mock_feature, '', 1)
        
        scenario_outline.should be_a_outline 
      end
      
      it "should create a step outline when adding new steps" do
        scenario_outline = ScenarioOutline.new(mock_feature, '', 1)
        
        StepOutline.should_receive(:new)
        
        scenario_outline.create_step('Given', '', 2)
      end
      
      it "should visit step outlines" do
        outline = ScenarioOutline.new(mock_feature, '', 1)
        outline.create_step('Given', '', 1)
        mock_visitor = mock('visitor')        
        
        mock_visitor.should_receive(:visit_step_outline)
        
        outline.accept(mock_visitor)
      end

      it "should include indent when padding to step" do
        scenario = ScenarioOutline.new(mock_feature, '', 1)
        scenario.create_step('Given', 'a longish step', 1)

        #Scenario Outline: ****
        #  Given a longish step
        scenario.padding_length.should == 4 + Scenario::INDENT
      end
      
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.13.2 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.13.3 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.13 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.14.1 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.14.2 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.15 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.16.1 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.16.2 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.16.3 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.16.4 spec/cucumber/tree/scenario_outline_spec.rb
aslakhellesoy-cucumber-0.1.16 spec/cucumber/tree/scenario_outline_spec.rb
kosmas58-cucumber-0.1.16.5 spec/cucumber/tree/scenario_outline_spec.rb
kosmas58-cucumber-0.1.16.6 spec/cucumber/tree/scenario_outline_spec.rb
cucumber-0.1.14 spec/cucumber/tree/scenario_outline_spec.rb
cucumber-0.1.13 spec/cucumber/tree/scenario_outline_spec.rb
cucumber-0.1.16 spec/cucumber/tree/scenario_outline_spec.rb
cucumber-0.1.15 spec/cucumber/tree/scenario_outline_spec.rb