Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 276 lines (190 sloc) 11.12 kB
f00623d @netzpirat Use secure build status image on Travis. [ci skip]
authored
1 # Guard::Cucumber [![Build Status](https://secure.travis-ci.org/netzpirat/guard-cucumber.png)](http://travis-ci.org/netzpirat/guard-cucumber)
db1a7f7 @netzpirat Add travis badge
authored
2
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
3 Guard::Cucumber allows you to automatically run Cucumber features when files are modified.
cea47e6 @netzpirat guard-cucumber also runs fine on MRI Ruby 1.8.6
authored
4
1e46cae @netzpirat Allow RBX to fail.
authored
5 Tested on MRI Ruby 1.9.3, 2.0.0, 2.1.0 and the latest versions of JRuby.
33b2855 @netzpirat I prefer markdown.
authored
6
fdf84ac @netzpirat Make sure questions go to the Google group and IRC.
authored
7 If you have any questions please join us on our [Google group](http://groups.google.com/group/guard-dev) or on `#guard` (irc.freenode.net).
18aa58b @netzpirat Colorize README and add Google group and irc channel
authored
8
33b2855 @netzpirat I prefer markdown.
authored
9 ## Install
10
30de627 @netzpirat Update README with changes from Guard.
authored
11 The simplest way to install Guard is to use [Bundler](http://gembundler.com/).
12 Please make sure to have [Guard](https://github.com/guard/guard) installed before continue.
33b2855 @netzpirat I prefer markdown.
authored
13
30de627 @netzpirat Update README with changes from Guard.
authored
14 Add Guard::Cucumber to your `Gemfile`:
33b2855 @netzpirat I prefer markdown.
authored
15
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
16 ```bash
30de627 @netzpirat Update README with changes from Guard.
authored
17 group :development do
18 gem 'guard-cucumber'
19 end
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
20 ```
33b2855 @netzpirat I prefer markdown.
authored
21
5d2bb9b @netzpirat Remove hint for obvious command. [ci skip]
authored
22 Add the default Guard::Cucumber template to your `Guardfile` by running:
33b2855 @netzpirat I prefer markdown.
authored
23
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
24 ```bash
25 $ guard init cucumber
26 ```
33b2855 @netzpirat I prefer markdown.
authored
27
28 ## Usage
29
d548b2a @netzpirat Use https on all GitHub links
authored
30 Please read the [Guard usage documentation](https://github.com/guard/guard#readme).
33b2855 @netzpirat I prefer markdown.
authored
31
32 ## Guardfile
33
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
34 Guard::Cucumber can be adapted to all kind of projects and comes with a default template that looks like this:
33b2855 @netzpirat I prefer markdown.
authored
35
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
36 ```ruby
37 guard 'cucumber' do
38 watch(%r{^features/.+\.feature$})
39 watch(%r{^features/support/.+$}) { 'features' }
40 watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
41 end
42 ```
33b2855 @netzpirat I prefer markdown.
authored
43
3e8e40c @netzpirat Fix broken markdown in README
authored
44 Expressed in plain English, this configuration tells Guard::Cucumber:
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
45
46 1. When a file within the features directory that ends in feature is modified, just run that single feature.
47 2. When any file within features/support directory is modified, run all features.
3e8e40c @netzpirat Fix broken markdown in README
authored
48 3. When a file within the features/step_definitions directory that ends in \_steps.rb is modified,
49 run the first feature that matches the name (\_steps.rb replaced by .feature) and when no feature is found,
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
50 then run all features.
51
52 Please read the [Guard documentation](http://github.com/guard/guard#readme) for more information about the Guardfile DSL.
53
33b2855 @netzpirat I prefer markdown.
authored
54 ## Options
55
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
56 You can pass any of the standard Cucumber CLI options using the :cli option:
57
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
58 ```ruby
59 guard 'cucumber', :cli => '-c --drb --port 1234 --profile guard'
60 ```
4b362a9 @netzpirat Cucumber arguments are now passed only through the CLI option.
authored
61
62 Former `:color`, `:drb`, `:port` and `:profile` options are thus deprecated and have no effect anymore.
63
64 ### List of available options
33b2855 @netzpirat I prefer markdown.
authored
65
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
66 ```ruby
67 :cli => '--profile guard -c' # Pass arbitrary Cucumber CLI arguments,
68 # default: '--no-profile --color --format progress --strict'
a341c93 @netzpirat Try new options format
authored
69
00efe28 Implemented :feature_sets option
Andreas Simon authored
70 :feature_sets => # Use non-default feature directory/ies
71 ['set_a', 'set_b'] # default: ['features']
72
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
73 :bundler => false # Don't use "bundle exec" to run the Cucumber command
74 # default: true
a341c93 @netzpirat Try new options format
authored
75
a2aef9d @hedgehog guard cucumber binstubs option (matches guard-rspec behavior).
hedgehog authored
76 :binstubs => true # use "bin/cucumber" to run the Cucumber command (implies :bundler => true)
77 # default: false
78
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
79 :rvm => ['1.8.7', '1.9.2'] # Directly run your features on multiple ruby versions
80 # default: nil
a341c93 @netzpirat Try new options format
authored
81
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
82 :notification => false # Don't display Growl (or Libnotify) notification
83 # default: true
a341c93 @netzpirat Try new options format
authored
84
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
85 :all_after_pass => false # Don't run all features after changed features pass
86 # default: true
a341c93 @netzpirat Try new options format
authored
87
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
88 :all_on_start => false # Don't run all the features at startup
89 # default: true
a341c93 @netzpirat Try new options format
authored
90
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
91 :keep_failed => false # Keep failed features until they pass
92 # default: true
33b2855 @netzpirat I prefer markdown.
authored
93
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
94 :run_all => { :cli => "-p" } # Override any option when running all specs
95 # default: {}
dbcf426 @netzpirat Add :run_all option
authored
96
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
97 :change_format => 'pretty' # Use a different cucumber format when running individual features
98 # This replaces the Cucumber --format option within the :cli option
99 # default: nil
935d3f0 @mikefarmer Add a command_prefix option.
mikefarmer authored
100
6254ae5 @netzpirat Remove duplicate paragraph.
authored
101 :command_prefix => 'xvfb-run' # Add a prefix to the cucumber command such as 'xvfb-run' or any
102 # other shell script.
935d3f0 @mikefarmer Add a command_prefix option.
mikefarmer authored
103 # The example generates: 'xvfb-run bundle exec cucumber ...'
104 # default: nil
2ba2ee9 @martco updates README to include focus_on option
martco authored
105
106 :focus_on => 'dev' # Focus on scenarios tagged with '@dev'
5e58b23 @martco line break for readability in README
martco authored
107 # If '@dev' is on line 6 in 'foo.feature',
108 # this example runs: 'bundle exec cucumber foo.feature:6'
2ba2ee9 @martco updates README to include focus_on option
martco authored
109 # default: nil
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
110 ```
ddcc684 @NickClark Update readme with failure_format option
NickClark authored
111
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
112 ## Cucumber configuration
36dc949 @netzpirat Add a section about configure Guard::Cucumber with Spork (Closes #6)
authored
113
b647acf @netzpirat Pimp the readme
authored
114 It's **very important** that you understand how Cucumber gets configured, because it's often the origin of
115 strange behavior of guard-cucumber.
36dc949 @netzpirat Add a section about configure Guard::Cucumber with Spork (Closes #6)
authored
116
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
117 Cucumber uses [cucumber.yml](https://github.com/cucumber/cucumber/wiki/cucumber.yml) for defining profiles
b647acf @netzpirat Pimp the readme
authored
118 of specific run configurations. When you pass configurations through the `:cli` option but don't include a
119 specific profile with `--profile`, then the configurations from the `default` profile are also used.
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
120
121 For example, when you're using the default cucumber.yml generated by [cucumber-rails](https://github.com/cucumber/cucumber-rails),
122 then the default profile forces guard-cucumber to always run all features, because it appends the `features` folder.
123
124 ### Configure Cucumber solely from Guard
125
a341c93 @netzpirat Try new options format
authored
126 If you want to configure Cucumber from Guard solely, then you should pass `--no-profile` to the `:cli` option.
b647acf @netzpirat Pimp the readme
authored
127
128 Since guard-cucumber version 0.3.2, the default `:cli` options are:
129
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
130 ```ruby
131 :cli => '--no-profile --color --format progress --strict'
132 ```
b647acf @netzpirat Pimp the readme
authored
133
134 This default configuration has been chosen to avoid strange behavior when mixing configurations form
135 the cucumber.yml default profile with the guard-cucumber `:cli` option.
136
137 You can safely remove `config/cucumber.yml`, since all configuration is done in the `Guardfile`.
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
138
139 ### Use a separate Guard profile
140
141 If you're using different profiles with Cucumber then you should create a profile for Guard in cucumber.yml,
142 something like this:
143
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
144 ```yaml
145 guard: --format progress --strict --tags ~@wip
146 ```
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
147
2e5cdd5 @netzpirat Better README formatting. [ci skip]
authored
148 Now you want to make guard-cucumber use that profile by passing `--profile guard` to the `:cli`.
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
149
150 ## Cucumber with Spork
151
152 To use Guard::Cucumber with [Spork](https://github.com/timcharper/spork), you should install
cf39d2b @netzpirat Reference the alternative Spork configurations in the Wiki.
authored
153 [Guard::Spork](https://github.com/guard/guard-spork) and use the following configuration:
415505e @netzpirat Change the :cli option to ignore the default profile from cucumber-ra…
authored
154
5298304 @netzpirat Let there be colors on GitHub and RubyDoc.
authored
155 ```ruby
156 guard 'spork' do
157 watch('config/application.rb')
158 watch('config/environment.rb')
159 watch(%r{^config/environments/.*\.rb$})
160 watch(%r{^config/initializers/.*\.rb$})
161 watch('spec/spec_helper.rb')
162 end
163
164 guard 'cucumber', :cli => '--drb --format progress --no-profile' do
165 watch(%r{^features/.+\.feature$})
166 watch(%r{^features/support/.+$}) { 'features' }
167 watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
168 end
169 ```
18aa58b @netzpirat Colorize README and add Google group and irc channel
authored
170
698de69 @netzpirat Better English in the README.
authored
171 There is a section with alternative configurations on the [Wiki](https://github.com/netzpirat/guard-cucumber/wiki/Spork-configurations).
cf39d2b @netzpirat Reference the alternative Spork configurations in the Wiki.
authored
172
084fc0d @andyw8 Add instructions for Zeus
andyw8 authored
173 ## Cucumber with Zeus
174
175 To use Guard::Cucumber with [Zeus](https://github.com/burke/zeus), just set the command prefix:
176 ```
096d512 @netzpirat Add infos about Spring (Fixes #39) [ci skip]
authored
177 guard 'cucumber', :command_prefix => 'zeus', :bundler => false do
084fc0d @andyw8 Add instructions for Zeus
andyw8 authored
178 ...
179 end
180 ```
096d512 @netzpirat Add infos about Spring (Fixes #39) [ci skip]
authored
181
182 You need to set `:bundler => false` to avoid using Bundler, as recommended in the Zeus documenation.
183
184 ## Cucumber with Spring
185
186 To use Guard::Cucumber with [Spring](https://github.com/jonleighton/spring), just set the command prefix:
187 ```
188 guard 'cucumber', :command_prefix => 'spring', :bundler => false do
189 ...
190 end
191 ```
192
193 You need to set `:bundler => false` to avoid using Bundler, as recommended in the Spring documenation.
084fc0d @andyw8 Add instructions for Zeus
andyw8 authored
194
30de627 @netzpirat Update README with changes from Guard.
authored
195 Issues
196 ------
197
198 You can report issues and feature requests to [GitHub Issues](https://github.com/netzpirat/guard-cucumber/issues). Try to figure out
8c774f7 @netzpirat Update README for Guard::Cucumber. [ci skip]
authored
199 where the issue belongs to: Is it an issue with Guard itself or with Guard::Cucumber? Please don't
30de627 @netzpirat Update README with changes from Guard.
authored
200 ask question in the issue tracker, instead join us in our [Google group](http://groups.google.com/group/guard-dev) or on
201 `#guard` (irc.freenode.net).
202
203 When you file an issue, please try to follow to these simple rules if applicable:
204
205 * Make sure you run Guard with `bundle exec` first.
206 * Add debug information to the issue by running Guard with the `--debug` option.
207 * Add your `Guardfile` and `Gemfile` to the issue.
208 * Make sure that the issue is reproducible with your description.
209
33b2855 @netzpirat I prefer markdown.
authored
210 ## Development
211
3c0ee53 @netzpirat Update RubyDoc link. [ci skip]
authored
212 - Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/guard-cucumber/master/frames).
9e72395 @netzpirat Add yardoc and some spec refactoring.
authored
213 - Source hosted at [GitHub](https://github.com/netzpirat/guard-cucumber).
33b2855 @netzpirat I prefer markdown.
authored
214
30de627 @netzpirat Update README with changes from Guard.
authored
215 Pull requests are very welcome! Please try to follow these simple rules if applicable:
33b2855 @netzpirat I prefer markdown.
authored
216
30de627 @netzpirat Update README with changes from Guard.
authored
217 * Please create a topic branch for every separate change you make.
218 * Make sure your patches are well tested.
219 * Update the [Yard](http://yardoc.org/) documentation.
220 * Update the README.
221 * Update the CHANGELOG for noteworthy changes.
222 * Please **do not change** the version number.
fdf84ac @netzpirat Make sure questions go to the Google group and IRC.
authored
223
30de627 @netzpirat Update README with changes from Guard.
authored
224 For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
225 `#guard` (irc.freenode.net).
068c5d9 @netzpirat Give credit to Neil Matatall.
authored
226
793e694 @netzpirat Replace contributors with link to Github. Its getting long.
authored
227 ## Author
228
860e94a @netzpirat Update website.
authored
229 Developed by Michael Kessler, sponsored by [FlinkFinger](http://www.flinkfinger.com).
793e694 @netzpirat Replace contributors with link to Github. Its getting long.
authored
230
231 If you like Guard::Cucumber, you can watch the repository at [GitHub](https://github.com/netzpirat/guard-cucumber)
232 and follow [@netzpirat](https://twitter.com/#!/netzpirat) on Twitter for project updates.
233
33b2855 @netzpirat I prefer markdown.
authored
234 ## Contributors
235
dc04032 @jaredmoody Fix contributors link in README
jaredmoody authored
236 See the GitHub list of [contributors](https://github.com/netzpirat/guard-cucumber/contributors).
33b2855 @netzpirat I prefer markdown.
authored
237
e2b60d3 @netzpirat When stealing is desired: Porting the :all_after_pass, :all_on_start …
authored
238 Since guard-cucumber is very close to guard-rspec, some contributions by the following authors have been
239 incorporated into guard-cucumber:
240
241 * [Andre Arko](https://github.com/indirect)
242 * [Thibaud Guillaume-Gentil](https://github.com/thibaudgg)
243
244 ## Acknowledgment
33b2855 @netzpirat I prefer markdown.
authored
245
246 The [Guard Team](https://github.com/guard/guard/contributors) for giving us such a nice pice of software
247 that is so easy to extend, one *has* to make a plugin for it!
248
d4e85c3 Spelling correction in README
holdensmagicalunicorn authored
249 All the authors of the numerous [Guards](http://github.com/guard) available for making the Guard ecosystem
33b2855 @netzpirat I prefer markdown.
authored
250 so much growing and comprehensive.
251
252 ## License
253
254 (The MIT License)
255
ea31c50 @netzpirat Update license year.
authored
256 Copyright (c) 2010-2013 Michael Kessler
33b2855 @netzpirat I prefer markdown.
authored
257
258 Permission is hereby granted, free of charge, to any person obtaining
259 a copy of this software and associated documentation files (the
260 'Software'), to deal in the Software without restriction, including
261 without limitation the rights to use, copy, modify, merge, publish,
262 distribute, sublicense, and/or sell copies of the Software, and to
263 permit persons to whom the Software is furnished to do so, subject to
264 the following conditions:
265
266 The above copyright notice and this permission notice shall be
267 included in all copies or substantial portions of the Software.
268
269 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
270 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
271 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
272 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
273 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
274 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
275 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.