Guard::Ecukes Build Status

Guard::Ecukes allows you to automatically run Ecukes features when files are modified.

Tested on MRI Ruby 1.8.7, 1.9.2, 1.9.3, REE and the latest versions of JRuby & Rubinius.

If you have any questions please join us on our Google group or on #guard (irc.freenode.net).

Install

The simplest way to install Guard is to use Bundler. Please make sure to have Guard installed before continue.

Add Guard::Ecukes to your Gemfile:

group :development do
  gem 'guard-ecukes
end

Add the default Guard::Ecukes template to your Guardfile by running:

$ guard init ecukes

Usage

Please read the Guard usage documentation.

Guardfile

Guard::Ecukes can be adapted to all kind of projects and comes with a default template that looks like this:

guard 'ecukes' do
  watch(%r{^features/.+\.feature$})
  watch(%r{^([^\/]*\.el|features/support/.+\.el)$})       { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.el$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

Expressed in plain English, this configuration tells Guard::Ecukes:

  1. When a file within the features directory that ends in feature is modified, just run that single feature.
  2. When any file within features/support directory is modified, run all features.
  3. 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.

Please read the Guard documentation for more information about the Guardfile DSL.

Options

You can pass any of the standard Ecukes CLI options using the :cli option:

guard 'ecukes', :cli => '--reporter magnars --timeout 10'

List of available options

:cli => '--reporter magnars --timeout 10' # Pass arbitrary Ecukes CLI arguments,
                                          # default: none

:all_after_pass => false                  # Don't run all features after changed features pass
                                          # default: true

:all_on_start => false                    # Don't run all the features at startup
                                          # default: true

:run_all => { :cli => "-r progress" }     # Override any option when running all specs
                                          # default: {}

:command_prefix => 'xvfb-run'             # Add a prefix to the ecukes command such as 'xvfb-run' or any
                                          # other shell script.
                                          # The example generates: 'xvfb-run bundle exec ecukes ...'
                                          # default: nil

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::Ecukes? 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.
  • Add your Guardfile and Gemfile to the issue.
  • Make sure that the issue is reproducible with your description.

Development

Pull requests are very welcome! Please try to follow these simple rules if applicable:

  • Please create a topic branch for every separate change you make.
  • Make sure your patches are well tested.
  • Update the README.
  • Please do not change the version number.

For questions please join us in our Google group or on #guard (irc.freenode.net).

Author

Forked from @netzpirat's guard-cucumber, developed by Michael Kessler, sponsored by mksoft.ch.

Contributors

See the GitHub list of contributors.

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.