You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,21 @@ Given there is a movie which is awesome, popular and successful but not science
39
39
And there is a director with the income "500000" but with the account balance "-30000"
40
40
```
41
41
42
+
If you have many attribute assignments you can use doc string or data table:
43
+
44
+
```cucumber
45
+
Given there is a movie with these attributes:
46
+
"""
47
+
name: Sunshine
48
+
comedy: false
49
+
"""
50
+
```
51
+
52
+
```cucumber
53
+
Given there is a movie with these attributes:
54
+
| name | Sunshine |
55
+
| comedy | false |
56
+
```
42
57
43
58
Setting associations
44
59
--------------------
@@ -70,6 +85,22 @@ And there is a movie with the prequel "Before Sunrise"
70
85
71
86
Note that in the example above, "Before Sunrise" is only a name you can use to refer to the record. The name is not actually used for the movie title, or any other attribute value.
72
87
88
+
It is not possible to define associations in doc string or data table, but you can combine them in one
89
+
step:
90
+
91
+
```cucumber
92
+
Given there is a movie with the prequel above and these attributes:
93
+
"""
94
+
name: Sunshine
95
+
comedy: false
96
+
"""
97
+
```
98
+
99
+
```cucumber
100
+
Given there is a movie with the prequel above and these attributes:
101
+
| name | Sunshine |
102
+
| comedy | false |
103
+
```
73
104
74
105
Support for popular factory gems
75
106
--------------------------------
@@ -134,12 +165,13 @@ There are tests in `spec`. We only accept PRs with tests. To run tests:
134
165
- Create a local MySQL database `cucumber_factory_test`
135
166
- Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local credentials for the test databases
136
167
- Install development dependencies using `bundle install`
137
-
- Run tests using `bundle exec rspec`
168
+
- Run tests with the default symlinked Gemfile using `bundle exec rspec` or explicit with `BUNDLE_GEMFILE=gemfiles/Gemfile.cucumber-x.x bundle exec rspec spec`
138
169
139
170
We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.travis.yml`. We provide some rake tasks to help with this:
140
171
141
-
- Install development dependencies using `bundle matrix:install`
142
-
- Run tests using `bundle matrix:spec`
172
+
For each ruby version do (you need to change it manually):
173
+
- Install development dependencies using `rake matrix:install`
174
+
- Run tests using `rake matrix:spec`
143
175
144
176
Note that we have configured Travis CI to automatically run tests in all supported Ruby versions and dependency sets after each push. We will only merge pull requests after a green Travis build.
0 commit comments