When a file within the features directory that ends in feature is modified, just run that single feature.

When any file within features/support directory is modified, run all features.

When a file within the features/step_definitions directory that ends in _steps.rb is modified,
run the first feature that matches the name (_steps.rb replaced by .feature) and when no feature is found,
then run all features.

Cucumber configuration

It's very important that you understand how Cucumber gets configured, because it's often the origin of
strange behavior of guard-cucumber.

Cucumber uses cucumber.yml for defining profiles
of specific run configurations. When you pass configurations through the :cli option but don't include a
specific profile with --profile, then the configurations from the default profile are also used.

For example, when you're using the default cucumber.yml generated by cucumber-rails,
then the default profile forces guard-cucumber to always run all features, because it appends the features folder.

Configure Cucumber solely from Guard

If you want to configure Cucumber from Guard solely, then you should pass --no-profile to the :cli option.

Since guard-cucumber version 0.3.2, the default :cmd_additional_args options are:

cmd_additional_args:'--no-profile --color --format progress --strict'

This default configuration has been chosen to avoid strange behavior when mixing configurations from
the cucumber.yml default profile with the guard-cucumber :cmd_additional_args option.

You can safely remove config/cucumber.yml, since all configuration is done in the Guardfile.

Use a separate Guard profile

If you're using different profiles with Cucumber then you should create a profile for Guard in cucumber.yml,
something like this:

guard:--format progress --strict --tags ~@wip

Now you want to make guard-cucumber use that profile by passing --profile guard to the :cli.

Cucumber with Spork

To use Guard::Cucumber with Spork, you should install
Guard::Spork and use the following configuration:

Issues

You can report issues and feature requests to GitHub Issues. Try to figure out
where the issue belongs to: Is it an issue with Guard itself or with Guard::Cucumber? Please don't
ask question in the issue tracker, instead join us in our Google group or on
#guard (irc.freenode.net).

When you file an issue, please try to follow to these simple rules if applicable:

Make sure you run Guard with bundle exec first.

Add debug information to the issue by running Guard with the --debug option.

Acknowledgment

The Guard Team for giving us such a nice pice of software
that is so easy to extend, one has to make a plugin for it!

All the authors of the numerous Guards available for making the Guard ecosystem
so much growing and comprehensive.

License

(The MIT License)

Copyright (c) 2010-2013 Michael Kessler

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.