File: strict_mode.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 (64 lines) | stat: -rw-r--r-- 1,735 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
Feature: Strict mode

  Using the `--strict` flag will cause cucumber to fail unless all the
  step definitions have been defined.

  Background:
    Given a file named "features/missing.feature" with:
    """
    Feature: Missing
      Scenario: Missing
        Given this step passes
    """
    And a file named "features/pending.feature" with:
    """
    Feature: Pending
      Scenario: Pending
        Given this step is pending
    """

  Scenario: Fail with --strict due to undefined step
    When I run `cucumber -q features/missing.feature --strict`
    Then it should fail with:
      """
      Feature: Missing

        Scenario: Missing
          Given this step passes
            Undefined step: "this step passes" (Cucumber::Undefined)
            features/missing.feature:3:in `Given this step passes'

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

  Scenario: Fail with --strict due to pending step
    Given the standard step definitions
    When I run `cucumber -q features/pending.feature --strict`
    Then it should fail with:
      """
      Feature: Pending

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

      1 scenario (1 pending)
      1 step (1 pending)
      """

  Scenario: Succeed with --strict
    Given the standard step definitions
    When I run `cucumber -q features/missing.feature --strict`
    Then it should pass with:
    """
    Feature: Missing

      Scenario: Missing
        Given this step passes

    1 scenario (1 passed)
    1 step (1 passed)
    """