File: writing_good_feature_tests.feature

package info (click to toggle)
ruby-aruba 0.14.8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,216 kB
  • sloc: ruby: 7,951; sh: 21; makefile: 12
file content (38 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download | duplicates (2)
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
Feature: Writing good feature tests with aruba to create documentations

  You can use Markdown within your feature tests. This is quite good to write a
  living documentation.

  There are some edge cases where Gherkin and Markdown don't agree. Bullet lists
  using `*` is one example. The `*` is also an alias for step keywords in
  Gherkin. Markdown headers (the kind starting with a `#`) is another example.
  They are parsed as comments by Gherkin. To use either of these, just escape
  them with a backslash. Alternatively just use the "-".

  You'd write:

  ```gherkin
  Scenario: Make tea
    \## Making tea
    \* Get a pot
    \* And some hot water

    Given...
  ```

  This way Gherkin won't recognize these lines as special tokens, and the
  reporter will render them as Markdown. (The reporter strips away any leading
  the backslashes before handing it off to the Markdown parser).

  Another option is to use alternative Markdown syntax and omit conflicts and
  escaping altogether:

  ```gherkin
  Scenario: Make tea
    Making tea
    ----------
    - Get a pot
    - And some hot water

    Given...
  ```