File: rake_task.feature

package info (click to toggle)
cucumber 2.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,076 kB
  • sloc: ruby: 17,016; javascript: 4,641; makefile: 12; sh: 10; tcl: 3
file content (141 lines) | stat: -rw-r--r-- 3,439 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@spawn
Feature: Rake task
  In order to ease the development process
  As a developer and CI server administrator
  Cucumber features should be executable via Rake

  Background:
    And a file named "features/missing_step_definitions.feature" with:
      """
      Feature: Sample

        Scenario: Wanted
          Given I want to run this

        Scenario: Unwanted
          Given I don't want this ran
      """

  Scenario: rake task with a defined profile
    Given the following profile is defined:
      """
      foo: --quiet --no-color features/missing_step_definitions.feature:3
      """
    And a file named "Rakefile" with:
      """
      require 'cucumber/rake/task'

      Cucumber::Rake::Task.new do |t|
        t.profile = "foo"
      end
      """
    When I run `rake cucumber`
    Then it should pass with:
      """
      Feature: Sample

        Scenario: Wanted
          Given I want to run this

      1 scenario (1 undefined)
      1 step (1 undefined)
      """

  Scenario: rake task without a profile
    Given a file named "Rakefile" with:
      """
      require 'cucumber/rake/task'

      Cucumber::Rake::Task.new do |t|
        t.cucumber_opts = %w{--quiet --no-color}
      end
      """
    When I run `rake cucumber`
    Then it should pass with:
      """
      Feature: Sample

        Scenario: Wanted
          Given I want to run this

        Scenario: Unwanted
          Given I don't want this ran

      2 scenarios (2 undefined)
      2 steps (2 undefined)
      """

  Scenario: rake task with a defined profile and cucumber_opts
    Given the following profile is defined:
      """
      bar: ['features/missing_step_definitions.feature:3']
      """
    And a file named "Rakefile" with:
      """
      require 'cucumber/rake/task'

      Cucumber::Rake::Task.new do |t|
        t.profile = "bar"
        t.cucumber_opts = %w{--quiet --no-color}
      end
      """
    When I run `rake cucumber`
    Then it should pass with:
      """
      Feature: Sample

        Scenario: Wanted
          Given I want to run this

      1 scenario (1 undefined)
      1 step (1 undefined)
      """

  Scenario: respect requires
    Given an empty file named "features/support/env.rb"
    And an empty file named "features/support/dont_require_me.rb"
    And the following profile is defined:
      """
      no_bomb: features/missing_step_definitions.feature:3 --require features/support/env.rb --verbose
      """
    And a file named "Rakefile" with:
      """
      require 'cucumber/rake/task'

      Cucumber::Rake::Task.new do |t|
        t.profile = "no_bomb"
        t.cucumber_opts = %w{--quiet --no-color}
      end
      """
    When I run `rake cucumber`
    Then it should pass
    And the output should not contain:
      """
        * features/support/dont_require_me.rb
      """

  Scenario: feature files with spaces
    Given a file named "features/spaces are nasty.feature" with:
       """
       Feature: The futures green

         Scenario: Orange
           Given this is missing
       """
    And a file named "Rakefile" with:
       """
       require 'cucumber/rake/task'

       Cucumber::Rake::Task.new do |t|
         t.cucumber_opts = %w{--quiet --no-color}
       end
       """
    When I run `rake cucumber`
    Then it should pass with:
       """
       Feature: The futures green

         Scenario: Orange
           Given this is missing

       """