File: specifying_multiple_formatters.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 (65 lines) | stat: -rw-r--r-- 1,969 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
@spawn
Feature: Running multiple formatters

  When running cucumber, you are able to using multiple different
  formatters and redirect the output to text files.
  Two formatters cannot both print to the same file (or to STDOUT)

  Background:
    Given a file named "features/test.feature" with:
    """
    Feature: Lots of undefined

      Scenario: Implement me
        Given it snows in Sahara
        Given it's 40 degrees in Norway
        And it's 40 degrees in Norway
        When I stop procrastinating
        And there is world peace
    """

  Scenario: Multiple formatters and outputs
    When I run `cucumber --no-color --format progress --out progress.txt --format pretty --out pretty.txt --no-source --dry-run --no-snippets features/test.feature`
    Then the stderr should not contain anything
    Then the file "progress.txt" should contain:
      """
      UUUUU

      1 scenario (1 undefined)
      5 steps (5 undefined)

      """
    And the file "pretty.txt" should contain:
      """
      Feature: Lots of undefined

        Scenario: Implement me
          Given it snows in Sahara
          Given it's 40 degrees in Norway
          And it's 40 degrees in Norway
          When I stop procrastinating
          And there is world peace

      1 scenario (1 undefined)
      5 steps (5 undefined)

      """

  Scenario: Two formatters to stdout
    When I run `cucumber -f progress -f pretty features/test.feature`
    Then it should fail with:
      """
      All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
      """

  Scenario: Two formatters to stdout when using a profile
    Given the following profiles are defined:
      """
      default: -q
      """
    When I run `cucumber -f progress -f pretty features/test.feature`
    Then it should fail with:
      """
      All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)
      """