Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Configure Guard to run Cucumber features

Add a dependency on the Guard::Cucumber RubyGem.
  • Loading branch information...
commit f4779066d7cbe12166592a728d38d0704471838c 1 parent 911af42
@njonsson authored
Showing with 28 additions and 6 deletions.
  1. +7 −6 Gemfile
  2. +21 −0 Guardfile
View
13 Gemfile
@@ -3,18 +3,19 @@ source 'http://rubygems.org'
gemspec
group :debug do
- gem 'ruby-debug', '~> 0', :platforms => :mri_18
- gem 'ruby-debug19', '~> 0', :platforms => :mri_19, :require => 'ruby-debug'
+ gem 'ruby-debug', '~> 0', :platforms => :mri_18
+ gem 'ruby-debug19', '~> 0', :platforms => :mri_19, :require => 'ruby-debug'
end
group :doc do
- gem 'yard', '~> 0', :platforms => [:ruby, :mswin, :mingw]
- gem 'rdiscount', :platforms => [:ruby, :mswin, :mingw]
+ gem 'yard', '~> 0', :platforms => [:ruby, :mswin, :mingw]
+ gem 'rdiscount', :platforms => [:ruby, :mswin, :mingw]
end
group :tooling do
- gem 'guard-rspec', '~> 2'
+ gem 'guard-cucumber', '~> 1'
+ gem 'guard-rspec', '~> 2'
if RUBY_PLATFORM =~ /darwin/i
- gem 'rb-fsevent', '~> 0', :require => false
+ gem 'rb-fsevent', '~> 0', :require => false
end
end
View
21 Guardfile
@@ -21,3 +21,24 @@ guard :rspec, :cli => '--debugger' do
# Run all specs when the bundle changes.
watch( 'Gemfile.lock' ) { 'spec' }
end
+
+guard :cucumber do
+ # Run run all features when code changes.
+ watch(%r{^lib/(.+)\.rb$}) { 'features' }
+
+ # Run the corresponding feature (or all features) when a step definition
+ # changes.
+ watch(%r{^features/step_definitions\.rb$}) { 'features' }
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |match|
+ Dir[File.join("**/#{match[1]}.feature")].first || 'features'
+ end
+
+ # Run a feature when it changes.
+ watch %r{^features/.+\.feature$}
+
+ # Run all features when the Cucumber configuration changes.
+ watch(%r{^features/support/.+$}) { 'features' }
+
+ # Run all features when the bundle changes.
+ watch('Gemfile.lock') { 'features' }
+end
Please sign in to comment.
Something went wrong with that request. Please try again.