File: step_matches_message.feature

package info (click to toggle)
ruby-cucumber-wire 0.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 224 kB
  • sloc: ruby: 754; makefile: 3
file content (79 lines) | stat: -rw-r--r-- 2,820 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
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
Feature: Step matches message

  When the features have been parsed, Cucumber will send a `step_matches`
  message to ask the wire server if it can match a step name. This happens for
  each of the steps in each of the features.

  The wire server replies with an array of StepMatch objects.

  When each StepMatch is returned, it contains the following data:

  * `id` - identifier for the step definition to be used later when if it
  needs to be invoked. The identifier can be any string value and
  is simply used for the wire server's own reference.
  * `args` - any argument values as captured by the wire end's own regular
  expression (or other argument matching) process.

  Background:
    Given a file named "features/wired.feature" with:
      """
      Feature: High strung
        Scenario: Wired
          Given we're all wired

      """
    And a file named "features/step_definitions/some_remote_place.wire" with:
      """
      host: localhost
      port: 54321

      """

  Scenario: Dry run finds no step match
    Given there is a wire server running on port 54321 which understands the following protocol:
      | request                                              | response       |
      | ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[]] |
    When I run `cucumber --dry-run --no-snippets -f progress`
    And it should pass with:
      """
      U

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

      """

  Scenario: Dry run finds a step match
    Given there is a wire server running on port 54321 which understands the following protocol:
      | request                                              | response                            |
      | ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[{"id":"1", "args":[]}]] |
    When I run `cucumber --dry-run -f progress`
    And it should pass with:
      """
      -

      1 scenario (1 skipped)
      1 step (1 skipped)

      """

  Scenario: Step matches returns details about the remote step definition

    Optionally, the StepMatch can also contain a source reference, and a native
    regexp string which will be used by some formatters.

    Given there is a wire server running on port 54321 which understands the following protocol:
      | request                                              | response                                                                           |
      | ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[{"id":"1", "args":[], "source":"MyApp.MyClass:123", "regexp":"we.*"}]] |
    When I run `cucumber -f stepdefs --dry-run`
    Then it should pass with:
      """
      -

      we.*   # MyApp.MyClass:123

      1 scenario (1 skipped)
      1 step (1 skipped)

      """
    And the stderr should not contain anything