macros4cuke 0.2.06 → 0.2.07
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/HISTORY.md +5 -0
- data/README.md +8 -8
- data/lib/macros4cuke/constants.rb +1 -1
- metadata +2 -2
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ _Add macros to your Cucumber scenarios._
|
|
5
5
|
[Homepage](https://github.com/famished-tiger/Macros4Cuke)
|
6
6
|
|
7
7
|
__Macros4Cuke__ is a lightweight library that adds a macro facility your Cucumber scenarios.
|
8
|
-
|
8
|
+
With it, you can create any new step that replaces a sequence of lower-level steps.
|
9
9
|
All this can be done directly in your feature files without programming step definitions.
|
10
10
|
|
11
11
|
### Highlights ###
|
@@ -16,7 +16,7 @@ __Macros4Cuke__ is a lightweight library that adds a macro facility your Cucumbe
|
|
16
16
|
* Data values can be passed to the sub-steps.
|
17
17
|
|
18
18
|
## A quick example ##
|
19
|
-
Here is
|
19
|
+
Here is a macro-step example taken from our demo files:
|
20
20
|
```cucumber
|
21
21
|
Given I define the step "When I [enter my userid <userid> and password <password>]" to mean:
|
22
22
|
"""
|
@@ -51,7 +51,7 @@ Macros4Cuke not only helps in getting rid of the repeated step sequences,
|
|
51
51
|
it allows the feature writers to create themselves higher-level steps
|
52
52
|
that are closer to the business logic.
|
53
53
|
|
54
|
-
See also the working examples in the features folder.
|
54
|
+
See also the working examples in the ```features/``` folder.
|
55
55
|
|
56
56
|
## Setup ##
|
57
57
|
### Installation ###
|
@@ -84,7 +84,7 @@ That's it! Now you can start writing macros in your Cucumber project.
|
|
84
84
|
|
85
85
|
## Getting started ##
|
86
86
|
Working with a macro-step is a two-stages process:
|
87
|
-
1. Defining a new macro-step
|
87
|
+
1. Defining a new macro-step; and,
|
88
88
|
2. Using that macro-step in a scenario.
|
89
89
|
|
90
90
|
Let's begin by taking a closer look at the definition part.
|
@@ -102,7 +102,7 @@ The defining step follows the general pattern:
|
|
102
102
|
The defining step has two key components:
|
103
103
|
1. The _quoted sentence_ ```"When I [some phrase]"```. That part
|
104
104
|
specifies the syntax of your future macro-step.
|
105
|
-
2. The multiline text enclosed between the triple quotes (""")
|
105
|
+
2. The multiline text enclosed between the triple quotes (""") that immediately follows the
|
106
106
|
the defining step. It is the place where the sub-steps are listed.
|
107
107
|
|
108
108
|
These two components are detailed now.
|
@@ -130,7 +130,7 @@ A phrase can be without argument as in:
|
|
130
130
|
```
|
131
131
|
|
132
132
|
Alternatively, a phrase can have one or more arguments enclosed between chevrons <...>.
|
133
|
-
For instance, the next first phrase has
|
133
|
+
For instance, the next first phrase has two arguments, the second has three arguments:
|
134
134
|
```cucumber
|
135
135
|
[enter my <userid> and <password>]
|
136
136
|
[travel from <origin> to <destination> via <waypoint>]
|
@@ -167,7 +167,7 @@ Sub-steps can also have macro arguments.
|
|
167
167
|
"""
|
168
168
|
```
|
169
169
|
|
170
|
-
### Using(invoking) a macro-step ###
|
170
|
+
### Using (invoking) a macro-step ###
|
171
171
|
The rules for using a given macro-step in a scenario are pretty straightforward:
|
172
172
|
- Follow closely the syntax of the _quoted sentence_ in the macro definition.
|
173
173
|
- Replace every \<argument\> in the _phrase_ by its actual value between quotes.
|
@@ -234,7 +234,7 @@ This step can be used like this:
|
|
234
234
|
|lastname|Doe|
|
235
235
|
|firstname|John|
|
236
236
|
|street_address| Main Street, 22|
|
237
|
-
|city| Old White
|
237
|
+
|city| Old White Castle|
|
238
238
|
|postcode|JK345|
|
239
239
|
```
|
240
240
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macros4cuke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.07
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|