macros4cuke 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +17 -19
- data/examples/demo/features/basic.feature +15 -0
- data/lib/macros4cuke/constants.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.3.10 / 2013-05-14
|
2
|
+
* [CHANGE] File `README.md`: Minor reformating.
|
3
|
+
* [CHANGE] File `basic.feature` (in examples/): Added one more macro-step example.
|
4
|
+
|
1
5
|
## 0.3.10 / 2013-05-14
|
2
6
|
* [CHANGE] File `README.md`: Expanded section on conditional section.
|
3
7
|
* [CHANGE] Method `Templating::Engine::parse` slightly refactored in order to decrease its complexity.
|
data/README.md
CHANGED
@@ -8,30 +8,29 @@ _Add macros to your Cucumber scenarios._
|
|
8
8
|
[Homepage](https://github.com/famished-tiger/Macros4Cuke)
|
9
9
|
|
10
10
|
__Macros4Cuke__ is a lightweight library that adds a macro facility your Cucumber scenarios.
|
11
|
-
With it, you can create any new step that replaces a sequence of lower-level steps.
|
11
|
+
With it, you can create any new step that replaces a sequence of lower-level steps (substeps).
|
12
12
|
All this can be done directly in your feature files without programming step definitions.
|
13
13
|
|
14
14
|
### Highlights ###
|
15
15
|
* Works with out-of-the-box Cucumber
|
16
16
|
* Simple installation and setup (no programming required),
|
17
|
+
* Familiar syntax for macro-step definitions,
|
17
18
|
* Substep sequence can be of arbitrary length,
|
18
19
|
* Macro-steps may have data arguments,
|
19
20
|
* Data values can be passed to the sub-steps.
|
20
|
-
|
21
|
-
In addtion, since version 0.3.01:
|
22
|
-
* Sub-steps can be made conditional.
|
21
|
+
* A section with sub-steps can be made conditional.
|
23
22
|
|
24
23
|
## A quick example ##
|
25
24
|
Here is a macro-step example taken from our demo files:
|
26
25
|
```cucumber
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
26
|
+
Given I define the step "When I [enter my userid <userid> and password <password>]" to mean:
|
27
|
+
"""
|
28
|
+
Given I landed in the homepage
|
29
|
+
When I click "Sign in"
|
30
|
+
And I fill in "Username" with "<userid>"
|
31
|
+
And I fill in "Password" with "<password>"
|
32
|
+
And I click "Submit"
|
33
|
+
"""
|
35
34
|
```
|
36
35
|
|
37
36
|
Notice how the arguments _userid_ and _password_ are enclosed between chevrons (angle brackets) <...>.
|
@@ -39,17 +38,16 @@ Notice how the arguments _userid_ and _password_ are enclosed between chevrons (
|
|
39
38
|
|
40
39
|
That macro-step can then be used in a scenario like this:
|
41
40
|
```cucumber
|
42
|
-
|
41
|
+
When I [enter my userid "jdoe" and password "hello-world"]
|
43
42
|
```
|
44
43
|
|
45
44
|
Once it is executing, the macro-step as the same effect as:
|
46
45
|
```cucumber
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
"""
|
46
|
+
Given I landed in the homepage
|
47
|
+
When I click "Sign in"
|
48
|
+
And I fill in "Username" with "jdoe"
|
49
|
+
And I fill in "Password" with "hello-world"
|
50
|
+
And I click "Submit"
|
53
51
|
```
|
54
52
|
|
55
53
|
In other words, this sequence of 5 steps can be replaced by just one.
|
@@ -5,6 +5,20 @@ Feature: Show -visually- the several ways to use macros
|
|
5
5
|
So that I enjoy writing scenario.
|
6
6
|
|
7
7
|
|
8
|
+
Scenario: Definition of a silly macro-step without argument
|
9
|
+
Given I define the step "* I [bark three times]" to mean:
|
10
|
+
"""
|
11
|
+
When I type "woof!"
|
12
|
+
And I type "Woof!"
|
13
|
+
And I type "WOOF!"
|
14
|
+
"""
|
15
|
+
|
16
|
+
Scenario: Let's bark
|
17
|
+
When I [bark three times]
|
18
|
+
# You should see woof! three times...
|
19
|
+
|
20
|
+
|
21
|
+
|
8
22
|
Scenario: Definition of a simple macro-step with two arguments
|
9
23
|
Given I define the step "* I [travel from <origin> to <destination>]" to mean:
|
10
24
|
"""
|
@@ -52,3 +66,4 @@ Scenario: Do a travel back and forth
|
|
52
66
|
# I arrive in Paris
|
53
67
|
|
54
68
|
|
69
|
+
# End of file
|
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.3.
|
4
|
+
version: 0.3.11
|
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-05-
|
12
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: 0.5.0
|
78
78
|
description: Create your own macro-steps directly in Cucumber scenarios.
|
79
|
-
email:
|
79
|
+
email: famished.tiger@yahoo.com
|
80
80
|
executables: []
|
81
81
|
extensions: []
|
82
82
|
extra_rdoc_files: []
|