macros4cuke 0.2.21 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +3 -0
- data/README.md +33 -1
- data/lib/macros4cuke/constants.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -245,7 +245,9 @@ Here are few observations worth noticing:
|
|
245
245
|
the value "Main Street, 22".
|
246
246
|
- Data rows don't have to follow strictly the order of the arguments in the sub-step sequence.
|
247
247
|
|
248
|
-
##
|
248
|
+
## Macro-step arguments ##
|
249
|
+
|
250
|
+
### Argument names ###
|
249
251
|
In line with most computer languages, Macros4Cuke accepts argument names containing alphanumeric characters and
|
250
252
|
underscores.
|
251
253
|
In fact, the only characters that are not allowed in argument names are the following punctuation or delimiting
|
@@ -253,6 +255,36 @@ signs:
|
|
253
255
|
__\!"'\#$%\&\*\+\-/,\.\:\;\=\?\(\)\<\>\[\]\{\}\\\^\`\|\~__
|
254
256
|
|
255
257
|
|
258
|
+
### Assigning a value to an argument ###
|
259
|
+
An argument appearing in the phrase MUST always be bound to a value at the step invokation.
|
260
|
+
Taking again a previous example of a -partial- macro-step definition:
|
261
|
+
```cucumber
|
262
|
+
Given I define the step "When I [travel from <origin> to <destination> via <stop>]" to mean:
|
263
|
+
"""
|
264
|
+
# Sub-steps come here...
|
265
|
+
"""
|
266
|
+
```
|
267
|
+
|
268
|
+
The following step invokation is invalid:
|
269
|
+
```cucumber
|
270
|
+
When I [travel from "San Francisco" to via "Las Vegas"]
|
271
|
+
```
|
272
|
+
|
273
|
+
The issue is: the destination value is missing, Macros4Cuke won't be able to find a step with that syntax.
|
274
|
+
The next invokation is syntactically correct for Macros4Cuke:
|
275
|
+
```cucumber
|
276
|
+
When I [travel from "San Francisco" to "" via "Las Vegas"]
|
277
|
+
```
|
278
|
+
|
279
|
+
The _destination_ argument gets an empty text as actual value.
|
280
|
+
|
281
|
+
For any argument that can receive a value through a data table, three situations can occur:
|
282
|
+
1. A row for that argument together with a text value are specified at invokation. The argument is bound to that text value.
|
283
|
+
2. A row for that argument and an empty text value are specified at invokation. The argument is bound to an empty text.
|
284
|
+
3. There is no row for that argument. The argument is unbound (nil) but is rendered as an empty text.
|
285
|
+
|
286
|
+
|
287
|
+
|
256
288
|
## With great power comes great responsibility. ##
|
257
289
|
_Stan Lee_
|
258
290
|
|