Sha256: 33abd0dcc89c607b4f386b34eab70d2127d62548bbdb9977c8d1991e55d80539

Contents?: true

Size: 1.41 KB

Versions: 13

Compression:

Stored size: 1.41 KB

Contents

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

module Cucumber
  module Tree
    describe Step do
      it "should have padding_length 2 when alone" do
        scenario = Scenario.new(nil, nil, 1)
        step = scenario.create_step('Given', '666666', 98)
        step.padding_length.should == 2
      end

      it "should have padding_length 5 when 3 shorter" do
        scenario = Scenario.new(nil, nil, 1)
        long = scenario.create_step('Given', '999999999', 80)
        step = scenario.create_step('Given', '666666', 98)
        step.padding_length.should == 5
      end
      
      it "should remove indent from padding_length if padding to scenario" do
        scenario = Scenario.new(nil, '9', 1)
        step = scenario.create_step('Given', '9', 80)

        #Scenario: 9  #
        #  Given 9****
        step.padding_length.should == 4
      end

      it "should default step arity to 0" do
        scenario = Scenario.new(nil, '9', 1)
        step = scenario.create_step('Given', '9', 80)
        
        step.arity.should == 0
      end

      describe "utf-8 strings" do

        it "should have padding_length 6 when 4 shorter" do
          scenario = Scenario.new(nil, nil, 1)
          long = scenario.create_step('Given', '999999999', 2)
          step = scenario.create_step('Given', "こんばんは", 3)
        
          step.padding_length.should == 6
        end

      end
      
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
aslakhellesoy-cucumber-0.1.10 spec/cucumber/tree/step_spec.rb
aslakhellesoy-cucumber-0.1.11 spec/cucumber/tree/step_spec.rb
aslakhellesoy-cucumber-0.1.12 spec/cucumber/tree/step_spec.rb
aslakhellesoy-cucumber-0.1.9 spec/cucumber/tree/step_spec.rb
bts-cucumber-0.1.13.1 spec/cucumber/tree/step_spec.rb
bts-cucumber-0.1.13.2 spec/cucumber/tree/step_spec.rb
bts-cucumber-0.1.13.3 spec/cucumber/tree/step_spec.rb
jeffrafter-cucumber-0.1.10 spec/cucumber/tree/step_spec.rb
jeffrafter-cucumber-0.1.12 spec/cucumber/tree/step_spec.rb
cucumber-0.1.12 spec/cucumber/tree/step_spec.rb
cucumber-0.1.11 spec/cucumber/tree/step_spec.rb
cucumber-0.1.10 spec/cucumber/tree/step_spec.rb
cucumber-0.1.9 spec/cucumber/tree/step_spec.rb