~ubuntu-branches/ubuntu/wily/cucumber/wily-proposed

« back to all changes in this revision

Viewing changes to spec/cucumber/ast/features_spec.rb

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier, Antonio Terceiro, Cédric Boutillier
  • Date: 2015-06-20 16:52:32 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150620165232-hznc8mxma08er27p
Tags: 2.0.0-1
[ Antonio Terceiro ]
* debian/cucumber.pod: fix typo in manpage (Closes: #767215)

[ Cédric Boutillier ]
* Imported Upstream version 2.0.0
* rename the file in debian/missing-source to remove -min suffix, and make
  lintian happy
* reproducibility: use last changelog date to build the manpage
* update 0004-Update_default_binary_path.patch
* drop 0001-Remove-rubygems-bundler-stuff-from-spec_helper.patch, not needed
  anymore
* build-depend on pry
* depend on ruby-cucumber-core

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
require 'spec_helper'
2
 
require 'cucumber/ast/feature_factory'
3
 
 
4
 
module Cucumber
5
 
  module Ast
6
 
    describe Features do
7
 
      it "has a step_count" do
8
 
        parse_feature(<<-GHERKIN)
9
 
Feature:
10
 
  Background:
11
 
    Given step 1
12
 
    And step 2
13
 
 
14
 
  Scenario:
15
 
    Given step 3
16
 
    And step 4
17
 
    And step 5
18
 
 
19
 
  Scenario Outline:
20
 
    Given step <n>
21
 
    And another step
22
 
 
23
 
    Examples:
24
 
      | n |
25
 
      | 6 |
26
 
      | 7 |
27
 
 
28
 
    Examples:
29
 
      | n |
30
 
      | 8 |
31
 
GHERKIN
32
 
 
33
 
        features.step_count.should == (2 + 3) + (3 * (2 + 2))
34
 
      end
35
 
 
36
 
      def parse_feature(gherkin)
37
 
        path    = 'features/test.feature'
38
 
        builder = Cucumber::Parser::GherkinBuilder.new(path)
39
 
        parser  = Gherkin::Parser::Parser.new(builder, true, "root", false)
40
 
        parser.parse(gherkin, path, 0)
41
 
        builder.language = parser.i18n_language
42
 
        feature = builder.result
43
 
        features.add_feature(feature)
44
 
      end
45
 
 
46
 
      let(:features) { Features.new }
47
 
 
48
 
    end
49
 
  end
50
 
end
51