Sha256: 288e5800124ab67b9f1e0e3bc17dcff82a5ccff5f0be8de99253652a5bc76a1d

Contents?: true

Size: 948 Bytes

Versions: 2

Compression:

Stored size: 948 Bytes

Contents

require 'spec_helper'

module Lucid
  module AST
    describe Spec do
      let(:spec) { Spec.new }

      def parse_feature(gherkin)
        path    = 'specs/test.spec'
        builder = Lucid::Parser::SpecBuilder.new(path)
        parser  = Gherkin::Parser::Parser.new(builder, true, 'root', false)
        parser.parse(gherkin, path, 0)
        builder.language = parser.i18n_language
        feature = builder.result
        spec.add_feature(feature)
      end

      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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lucid-0.4.1 spec/lucid/ast/specs_spec.rb
lucid-0.4.0 spec/lucid/ast/specs_spec.rb