Sha256: d73ac2f875cc1b35f8cf5b49fa727e87442960f0716558907dde1b13a94b2bb9

Contents?: true

Size: 968 Bytes

Versions: 24

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'
require 'cucumber/ast/feature_factory'

module Cucumber
  module Ast
    describe Features do
      it "has a step_count" do
        parse_feature(<<-GHERKIN)
Feature:
  Background:
    Given step 1
    And step 2

  Scenario:
    Given step 3
    And step 4
    And step 5

  Scenario Outline:
    Given step <n>
    And another step

    Examples:
      | n |
      | 6 |
      | 7 |

    Examples:
      | n |
      | 8 |
GHERKIN

        features.step_count.should == (2 + 3) + (3 * (2 + 2))
      end

      def parse_feature(gherkin)
        path    = 'features/test.feature'
        builder = Cucumber::Parser::GherkinBuilder.new(path)
        parser  = Gherkin::Parser::Parser.new(builder, true, "root", false)
        parser.parse(gherkin, path, 0)
        builder.language = parser.i18n_language
        feature = builder.result
        features.add_feature(feature)
      end

      let(:features) { Features.new }

    end
  end
end

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/spec/cucumber/ast/features_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/spec/cucumber/ast/features_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/spec/cucumber/ast/features_spec.rb
cucumber-1.3.20 spec/cucumber/ast/features_spec.rb
cucumber-1.3.19 spec/cucumber/ast/features_spec.rb
cucumber-1.3.18 spec/cucumber/ast/features_spec.rb
cucumber-1.3.17 spec/cucumber/ast/features_spec.rb
cucumber-1.3.16 spec/cucumber/ast/features_spec.rb
cucumber-1.3.15 spec/cucumber/ast/features_spec.rb
cucumber-1.3.14 spec/cucumber/ast/features_spec.rb
cucumber-1.3.13 spec/cucumber/ast/features_spec.rb
cucumber-1.3.12 spec/cucumber/ast/features_spec.rb
cucumber-1.3.11 spec/cucumber/ast/features_spec.rb
cucumber-1.3.10 spec/cucumber/ast/features_spec.rb
cucumber-1.3.9 spec/cucumber/ast/features_spec.rb
cucumber-1.3.8 spec/cucumber/ast/features_spec.rb
cucumber-1.3.7 spec/cucumber/ast/features_spec.rb
cucumber-1.3.6 spec/cucumber/ast/features_spec.rb
cucumber-1.3.5 spec/cucumber/ast/features_spec.rb
cucumber-1.3.4 spec/cucumber/ast/features_spec.rb