File: work_in_progress.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 (154 lines) | stat: -rw-r--r-- 4,064 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
142
143
144
145
146
147
148
149
150
151
152
153
154
@spawn
Feature: Cucumber --work-in-progress switch
  In order to ensure that feature scenarios do not pass until they are expected to
  Developers should be able to run cucumber in a mode that
            - will fail if any scenario passes completely
            - will not fail otherwise

  Background: A passing and a pending feature
    Given the standard step definitions
    And a file named "features/wip.feature" with:
      """
      Feature: WIP
        @failing
        Scenario: Failing
          Given this step raises an error

        @undefined
        Scenario: Undefined
          Given this step is undefined

        @pending
        Scenario: Pending
          Given this step is pending

        @passing
        Scenario: Passing
          Given this step passes
      """
    And a file named "features/passing_outline.feature" with:
      """
      Feature: Not WIP
        Scenario Outline: Passing
          Given this step <what>

          Examples:
            | what   |
            | passes |
      """

  Scenario: Pass with Failing Scenarios
    When I run `cucumber -q -w -t @failing features/wip.feature`
    Then the stderr should not contain anything
    Then it should pass with:
      """
      Feature: WIP

        @failing
        Scenario: Failing
          Given this step raises an error
            error (RuntimeError)
            ./features/step_definitions/steps.rb:2:in `/^this step raises an error$/'
            features/wip.feature:4:in `Given this step raises an error'

      Failing Scenarios:
      cucumber features/wip.feature:3

      1 scenario (1 failed)
      1 step (1 failed)
      """
    And the output should contain:
      """
      The --wip switch was used, so the failures were expected. All is good.

      """

  Scenario: Pass with Undefined Scenarios
    When I run `cucumber -q -w -t @undefined features/wip.feature`
    Then it should pass with:
      """
      Feature: WIP

        @undefined
        Scenario: Undefined
          Given this step is undefined

      1 scenario (1 undefined)
      1 step (1 undefined)
      """
    And the output should contain:
      """
      The --wip switch was used, so the failures were expected. All is good.

      """

  Scenario: Pass with Undefined Scenarios
    When I run `cucumber -q -w -t @pending features/wip.feature`
    Then it should pass with:
      """
      Feature: WIP

        @pending
        Scenario: Pending
          Given this step is pending
            TODO (Cucumber::Pending)
            ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
            features/wip.feature:12:in `Given this step is pending'

      1 scenario (1 pending)
      1 step (1 pending)
      """
    And the output should contain:
      """
      The --wip switch was used, so the failures were expected. All is good.

      """

  Scenario: Fail with Passing Scenarios
    When I run `cucumber -q -w -t @passing features/wip.feature`
    Then it should fail with:
      """
      Feature: WIP

        @passing
        Scenario: Passing
          Given this step passes

      1 scenario (1 passed)
      1 step (1 passed)
      """
    And the output should contain:
      """
      The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
      (::) passed scenarios (::)

      features/wip.feature:15:in `Scenario: Passing'


      """

  Scenario: Fail with Passing Scenario Outline
    When I run `cucumber -q -w features/passing_outline.feature`
    Then it should fail with:
      """
      Feature: Not WIP

        Scenario Outline: Passing
          Given this step <what>

          Examples: 
            | what   |
            | passes |

      1 scenario (1 passed)
      1 step (1 passed)
      """
    And the output should contain:
      """
      The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
      (::) passed scenarios (::)

      features/passing_outline.feature:7:in `Scenario Outline: Passing, Examples (#1)'


      """