Sha256: 53d0ebd414bdc534c734d4a2ddf95c0a018d30ce8a373a86d0b2bd7448499570

Contents?: true

Size: 1.02 KB

Versions: 92

Compression:

Stored size: 1.02 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/step_mother'
require 'cucumber/ast'

module Cucumber
  describe FeatureElement do
    include FeatureElement

    describe "with multiline names" do
      it "should select the longest line as the text length" do
        @keyword = "key"  
        @name = "short\nvery longer\ntiny"
        text_length.should == 11 + Ast::Step::INDENT - 1
      end
      
      it "should add keyword to first lines length" do
        @keyword = "key"  
        @name = "short\nvery longer\ntiny"
        
        first_line_length.should == (@keyword.jlength) + (first_line_name_length = 5)
      end
    end
    
    describe "with empty name" do
      it "should only return the length of the keyword" do
        @name = ""
        @keyword = "key"
        
        text_length.should == 3
      end
    end

    it "should support checking if its name matches a list of regexps" do
      @name = 'test'
      matches_scenario_names?([/es/]).should be_true
    end
    
  end
end

Version data entries

92 entries across 92 versions & 9 rubygems

Version Path
aslakhellesoy-cucumber-0.3.1.1 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.1 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.10 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.100 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.101 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11.1 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11.200907091518 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11.3 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11.5 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11.6 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.11 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.2 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.1 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.2 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.3 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.4 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.5 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3.6 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.3 spec/cucumber/ast/feature_element_spec.rb
aslakhellesoy-cucumber-0.3.4 spec/cucumber/ast/feature_element_spec.rb