Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 4cd282d

Browse files
authored
Use Cucumber expressions in examples consistently (#430)
1 parent 69a4e47 commit 4cd282d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

content/docs/cucumber/step-definitions.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ Given('I have {int} cukes in my belly', function (cukes) {
114114

115115
# Expressions
116116

117-
A step definition's *expression* can either be a [Regular Expression](https://en.wikipedia.org/wiki/Regular_expression) or a [Cucumber Expression](/docs/cucumber/cucumber-expressions). If you prefer to use Regular Expressions, each *capture group* from the match will be passed as arguments to the step definition's {{% stepdef-body %}}.
117+
A step definition's *expression* can either be a [Regular Expression](https://en.wikipedia.org/wiki/Regular_expression)
118+
or a [Cucumber Expression](/docs/cucumber/cucumber-expressions). The examples in this section use Cucumber Expressions.
119+
If you prefer to use Regular Expressions, each *capture group* from the match will be passed as arguments to the step
120+
definition's {{% stepdef-body %}}.
118121

119122
{{% block "java" %}}
120123
```java
@@ -134,14 +137,14 @@ Given("I have {int} cukes in my belly") { cukes: Int ->
134137

135138
{{% block "ruby" %}}
136139
```ruby
137-
Given(/I have (\d+) cukes in my belly/) do |cukes|
140+
Given(/I have {int} cukes in my belly/) do |cukes|
138141
end
139142
```
140143
{{% /block %}}
141144

142145
{{% block "javascript" %}}
143146
```javascript
144-
Given(/I have (\d+) cukes in my belly/, function (cukes) {
147+
Given(/I have {int} cukes in my belly/, function (cukes) {
145148
});
146149
```
147150
{{% /block %}}

0 commit comments

Comments
 (0)