Code Monkey home page Code Monkey logo

guard-cucumber's People

Contributors

andyw8 avatar cpb avatar dnagir avatar hedgehog avatar hron avatar jeanmertz avatar kjellm avatar lmarburger avatar lorennorman avatar martco avatar mgarriott avatar mikefarmer avatar netzpirat avatar nickclark avatar oriolgual avatar robertzx avatar thecatwasnot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guard-cucumber's Issues

stop running feature

When I press Ctrl-C then guard-cucumber is turned off as specified in https://github.com/guard/guard#readme

Is there any way to stop running feature(s) in guard-cucumber ?

The problem is that guard-cucumber autofires cucumber tests with autosave, but I don't want it in cukes having 10's of feautes.

Another solution might be to make guard-cucumber run only the specific feature which has been modified and not the whole cuke.

Guard fails when using rvm 1.9.3

It appears to be trying to register with growl for notifications, but it's failing

OSERROR: -10000
MESSAGE: Apple event handler failed.
COMMAND: app("/Users/DVG/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").register({:all_notifications=>["success", "pending", "failed", "notify"], :as_application=>"Guard", :default_notifications=>"notify"})
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in method_missing' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/growl_notify-0.0.3/lib/growl_notify.rb:29:inregister'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/growl_notify-0.0.3/lib/growl_notify.rb:19:in config' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifiers/growl_notify.rb:42:inavailable?'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:109:in add_notification' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:146:inblock in auto_detect_notification'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:146:in each' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:146:inany?'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:146:in auto_detect_notification' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/notifier.rb:72:inturn_on'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard.rb:167:in start' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/lib/guard/cli.rb:74:instart'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor.rb:263:in dispatch' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/base.rb:389:instart'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.9.1/bin/guard:6:in <top (required)>' from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/bin/guard:19:inload'
from /Users/DVG/.rvm/gems/ruby-1.9.3-p0/bin/guard:19:in `

'

I switched over to the system default 1.8.7, and it at least got farther, but then my config files didn't work because of 1.9.3 style syntax

gem dependencies

Could guard-cucumber (0.3.4) depend on guard 0.4.0 instead of '~> 0.3.1' so I can use guard-rspec(0.4.0 which depends on guard 0.4.0) and guard-cucumber together?

--no-profile doesn't seem to be a thing on latest cucumber

Getting this error with the default cucumber guard:

/Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1036:in `block in process_args': invalid option: --no-profile (OptionParser::InvalidOption)
    from /Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1015:in `new'
    from /Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1015:in `process_args'
    from /Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1065:in `_run'
    from /Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:1058:in `run'
    from /Users/alex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitest-4.7.5/lib/minitest/unit.rb:794:in `block in autorun'

Permit GUI notifcations and stdout/stderr logging of missing steps

I'm on Ubuntu 10.04, and following the guard-cucumber readme I use the libnotify and rb-inotify gems.

I launch the guard:

bundle exec guard start --group template 2>&1|tee tmp/log/guard/template.log

When I set :notification => true I do see GUI notifications of missing steps but these do not appear in the template.log file.

When I set :notification => false I do get the full output in the template.log but no GUI notifications.

Is this intended behavior?

If not then there is a way to work around this issue until a fix is found:

  • set the guard-cucumber option :notification => true
  • set the cucumber option --format pretty

binstubs option seems to be ignored

It looks like the :binstubs => true option is ignored.

Here is the verbose output of guard:

> bin/guard -g features --verbose
Guard uses GNTP to send notifications.
Guard is now watching at '/Users/dnagir/proj/abc'
DEBUG (17:33:51): Hook :start_begin executed for Guard::Cucumber
Running all features
DEBUG (17:33:51): Command execution: bundle exec cucumber --color --format pretty --no-profile --tags @focus --require /Users/dnagir/.rvm/gems/jruby-1.6.5.1/gems/guard-cucumber-0.7.4/lib/guard/cucumber/notification_formatter.rb --format Guard::Cucumber::NotificationFormatter --out /dev/null --require features features 
Disabling profiles...

And the config is:

guard 'cucumber', :binstubs => true, :cli => '--color --format pretty --no-profile '--tags @focus do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$})          { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

Using the guard from master branch and guard-cucumber (0.7.4).

Am I doing something wrong?

:feature_sets defined in Guardfile is not taken in account

I have put my features in a subfolder hierarchy, and the path is defined in the Guardfile, thanks to the feature_sets option:

guard 'cucumber', :cli => '--profile default', :feature_sets => ['tests/features'] do
  watch(%r{(^tests/features/.+\.feature$)})                   { |m| m }
 end

When I launch guard, all tests are passed, but when I modify a file under watch (a .feature file in tests/features), guard doesn't see the modification.

This seems to be caused by line 86 in lib/guard/cucumber.rb:

paths = Inspector.clean(paths)

It seems that Inspector.clean doesn't take in account the :feature_sets option passed.

growl is not working

I have growl_notify and when guard is running cucumber features it blows up when trying to do a growl notification. The growl for rspec seems to work.

guard-cucumber error on ruby 1.9.3 (clean app)

I've started a new rails app (3.2.3) from scratch with ruby-1.9.3-p194. I get a crash when running guard-cucumber. Plain cucumber using rake cucumber works fine.

Details:

I have the following simple feature file

Feature: User Signup
  In order to use the site
  As a user
  I want to sign up to the site

  Scenario: User signs up to the site
    Given I want to sign up
    When I arrive to the home page
    Then I should see a "signup" link

My Guardfile looks like so (generated using bundle exec guard init rspec and bundle exec guard init cucumber:

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'rspec', :version => 2 do
  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch('spec/spec_helper.rb')  { "spec" }

  # Rails example
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  # Capybara request specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
end

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

My Gemfile looks like this:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'sqlite3'
gem 'devise'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use debugger
gem 'debugger', :group => [ :development, :test ]
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'factory_girl_rails'
  gem 'guard-rspec'
  gem 'guard-cucumber'
  gem 'cucumber-rails'
  gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
end

When I start guard with bundle exec guard, I get the following stack trace:

Running all features
Disabling profiles...
wrong number of arguments (6 for 5) (ArgumentError)
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/guard-cucumber-0.7.5/lib/guard/cucumber/notification_formatter.rb:69:in `step_name'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:173:in `block in send_to_all'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:171:in `each'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:171:in `send_to_all'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:166:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:112:in `visit_step_name'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:105:in `block in visit_step_result'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:104:in `visit_step_result'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/step_invocation.rb:43:in `visit_step_result'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/step_invocation.rb:39:in `accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/step_collection.rb:14:in `each'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/step_collection.rb:14:in `accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/scenario.rb:55:in `block (2 levels) in accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:80:in `block (2 levels) in with_hooks'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:96:in `before_and_after'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:79:in `block in with_hooks'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime/support_code.rb:120:in `call'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime/support_code.rb:120:in `block (3 levels) in around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/language_support/language_methods.rb:9:in `block in around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/language_support/language_methods.rb:91:in `call'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/language_support/language_methods.rb:91:in `execute_around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/language_support/language_methods.rb:8:in `around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime/support_code.rb:119:in `block (2 levels) in around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime/support_code.rb:117:in `call'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime/support_code.rb:117:in `around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:91:in `around'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:78:in `with_hooks'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/scenario.rb:53:in `block in accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/scenario.rb:108:in `with_visitor'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/scenario.rb:47:in `accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/feature.rb:43:in `block in accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/feature.rb:42:in `each'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/feature.rb:42:in `accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/features.rb:29:in `block in accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/features.rb:17:in `each'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/features.rb:17:in `each'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/features.rb:28:in `accept'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/runtime.rb:46:in `run!'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/lib/cucumber/cli/main.rb:20:in `execute'
/Users/shilo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.0/bin/cucumber:14:in `<top (required)>'
/Users/shilo/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in `load'
/Users/shilo/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in `<main>'

I've seen a previous issue (#28) mentioning 1.9.3 problem, but it was closed due to inactivity. Any ideas what's going on?

rerun.txt

Hi. I'm sharing folders between windows and linux and when using guard-cucumber I get this error:

ERROR: Guard::Cucumber failed to achieve its , exception was:
Errno::ETXTBSY: Text file busy - rerun.txt
.../guard-cucumber-0.7.2/lib/guard/cucumber.rb:114:in delete
.../guard-cucumber-0.7.2/lib/guard/cucumber.rb:114:in read_failed_features
.../guard-cucumber-0.7.2/lib/guard/cucumber.rb:60:in run_all
...

Guard::Cucumber has just been fired
(running a rm rerun.txt is working fine)

It can be avoided using :keep_failed => false, but I'd be cool if we can fix it.

focus_on: 'dev' has no effect

By default, guard-cucumber disables the @wip tag (--tags ~@wip). I'm trying to have the ability to apply a focus tag or wip tag to be able to focus on a particular scenario when the scenario is tagged with the appropriate tag. In the README, it gives the impression that the focus_on: 'dev' option is intended for this case. However, adding this option to my Guardfile, and adding the @dev tag to my scenario has no effect. I am using spork which may be partly to blame. I have the default config/cucumber.yml file, but guard runs with the --no-profile option so it shouldn't matter. Here's my Guardfile:

guard 'spork', cucumber: true, test_unit: false, rspec: true, bundler: false, wait: 50, rspec_env: { 'RAILS_ENV' => 'test' } do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/environments/.+\.rb$})
  watch(%r{^config/initializers/.+\.rb$})
  watch('spec/spec_helper.rb')
end

guard 'cucumber', all_on_start: false, cli: '--drb', focus_on: 'dev' do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$}) { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

Here's the cucumber run options:

11:56:33 - INFO - Running Cucumber features: bundle exec cucumber --drb --require /Users/andrew/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/guard-cucumber-1.2.2/lib/guard/cucumber/notification_formatter.rb --format Guard::Cucumber::NotificationFormatter --out /dev/null --require features features/promotions/exclusion_from_free_shipping.feature
Using the default profile...
Running tests with args ["--require", "/Users/andrew/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/guard-cucumber-1.2.2/lib/guard/cucumber/notification_formatter.rb", "--format", "Guard::Cucumber::NotificationFormatter", "--out", "/dev/null", "--require", "features", "features/promotions/exclusion_from_free_shipping.feature", "--format", "pretty", "--strict", "--tags", "~@wip", "--no-profile"]...
Disabling profiles...

Let me know if you need anything else.

Error when running with Rails4, Ruby2

When running guard-cucumber I get the following output at the end of tests;

/Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:1037:in `block in process_args': invalid option: --no-profile (OptionParser::InvalidOption)
        from /Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:1016:in `new'
        from /Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:1016:in `process_args'
        from /Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:1066:in `_run'
        from /Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:1059:in `run'
        from /Users/john/.rvm/gems/ruby-2.0.0-p195@mindr/gems/minitest-4.7.5/lib/minitest/unit.rb:795:in `block in autorun'

i don't get this if I run cucumber directly from the command line.

I'm not sure where to start looking.

duplicate tests being run after a failure

Run Cucumber features features/password_client.feature

-break test

Run Cucumber features features/password_client.feature

-fix test

Run Cucumber features features/password_client.feature features/
password_client.feature:22

All tests get run, and the feature on 22 gets run twice. Should only
be once, right?

Add support for spring

A similar undertaking went on for the rspec-guard gem. Hopefully this one is similar?

guard/guard-rspec#152

I haven't looked into this at all, I'm just wishing for the feature ๐Ÿ‘…

Thanks

Guard is not a module error

Trying to get a set of features running with Guard and Guard Cucumber. I've got a Guardfile with the following contents:

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

When starting Guard I get:

Running all features
Disabling profiles...
Guard is not a module (TypeError)
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.7.0/lib/guard/ui.rb:1:in `<top (required)>'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `block in require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:227:in `load_dependency'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.7.0/lib/guard/notifier.rb:3:in `<top (required)>'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `block in require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:227:in `load_dependency'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/guard-cucumber-0.6.3/lib/guard/cucumber/notification_formatter.rb:2:in `<top (required)>'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `block in load'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:227:in `load_dependency'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime.rb:39:in `run!'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/cli/main.rb:20:in `execute'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/bin/cucumber:14:in `<top (required)>'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `load'
/Users/jacob/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `<main>'

Cucumber formatter conflict

I've got a stock cucumber install (aside from spork setup?) and am trying to get guard-spork/guard-cucumber to run with it.

I encountered an issue with a conflict from guard and my stock cucumber.yml file, In the end I just changed my default cucumber profile so that it did not automatically call a formatter. Is there a better way to handle this?
Also a note in the readme wouldn't go amiss either :)

cucumber.yml now looks like:
std_opts = "--strict --tags ~@wip"
%>
default: --drb <%= std_opts %> features

All tests are run after a pass, despite setting after_all_pass to false and using --no-profile

I am using guard-cucumber 1.2.0, and have the following section in my Guardfile. Despite setting after_all_pass to false and using --no-profile, all tests run after a file passes.

guard 'cucumber', all_on_start: false, after_all_pass: false, cli: "--no-profile --color --format Cucumber::Formatter::Fuubar --strict" do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$})          { 'features' }
  watch(%r{^app/views/layouts/application\.html(\.erb|\.haml)$})                 { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

This means that after saving a .feature file containing 3 tests, if it passes the entire suite containing over 300 tests (some of which use Selenium) will run.

If I'm doing something wrong, please could someone tell me what it is, because I seem to have done everything the docs suggest, and my only option at the moment seems to be to disable Guard and run features manually.

Thanks

Really keeping failures

Hi, I wanted to discuss this before attempting to fix/contribute.

The keep_failed option doesn't always preserve failures between invocations and any failures inside the file are deleted.

This happens when a "cucumber features" is triggered on file change, and not "cucumber features file:line" (based on cucumber watcher rules in the Guardfile).

Basically, whenever running all the tests is requested, rerun.txt files and previous failures are ignored.

This doesn't make sense from a workflow perspective, since this can rerun hundreds of tests even when rerun.txt still contains a failure.

Solution: rerun.txt should be treated as a persistent storage (database) for failures, taking priority even when all tests are asked to be run.

This is ok, since all tests are run anyway after recent failures pass. Failures should only be cleared when they actually pass, not when all tests are asked to be run.

Implementation (write_rerun_feature): first read the contents of the existing rerun.txt file, merge those with existing failures, then overwrite the file.

Let me know if this makes sense to you.

always run selenium tests

Hey,

I defined two cucumber profiles: default(for browser simulated tests) and selenium(for selenium tests), they looks like the following:
default: --tags ~@wip --tags ~@Selenium -r features/support/env.rb -r features/support/paths.rb -r features/support/hooks.rb -r features/support/world.rb -r features/step_definitions --color --format progress features

selenium: --tags @Selenium -r features/support/env.rb -r features/support/paths.rb -r features/support/hooks.rb -r features/support/world.rb -r features/support/selenium.rb -r features/step_definitions

But whenever I tried to run guard with default profile, it started selenium CI server, opened a browser, then ran selenium tests.
I found the following lines in runner.rb:
if options[:notification] != false
notification_formatter_path = File.expand_path(File.join(File.dirname(FILE), 'notification_formatter.rb'))
cmd << "--require #{ notification_formatter_path }"
cmd << "--format Guard::Cucumber::NotificationFormatter"
cmd << "--out #{ null_device }"
cmd << "--require features"
end
When we comment 'cmd << "--require features"', the tests can really run in default profile, otherwise it will always run selenium tests. Question is what that line of code for?

Fails on cucumber 2.0.0.beta.3

undefined method `file_colon_line' for #<Cucumber::Reports::Legacy::Ast::Scenario:0x007fe348d940d0> (NoMethodError)
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/guard-cucumber-1.4.1/lib/guard/cucumber/notification_formatter.rb:56:in `after_feature_element'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:19:in `block in method_missing'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:18:in `each'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:18:in `method_missing'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:515:in `after'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:505:in `after_test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:232:in `after_test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:97:in `after_test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/reports/legacy_formatter.rb:47:in `after_test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/runner.rb:113:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/mapper.rb:18:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime.rb:286:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/filters.rb:14:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/filters.rb:30:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/filters/tag_filter.rb:10:in `test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/test/case.rb:20:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/compiler.rb:35:in `on_test_case'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/compiler.rb:71:in `scenario'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/ast/describes_itself.rb:6:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/ast/describes_itself.rb:8:in `block (2 levels) in describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/ast/describes_itself.rb:7:in `each'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/ast/describes_itself.rb:7:in `block in describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/compiler.rb:56:in `call'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/compiler.rb:56:in `feature'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/ast/describes_itself.rb:6:in `describe_to'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/compiler.rb:12:in `feature'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core/gherkin/parser.rb:19:in `document'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core.rb:12:in `block in parse'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core.rb:11:in `each'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core.rb:11:in `parse'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core.rb:23:in `compile'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-core-1.0.0.beta.3/lib/cucumber/core.rb:31:in `execute'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime.rb:71:in `run!'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/cli/main.rb:38:in `execute!'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/bin/cucumber:9:in `<top (required)>'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:242:in `load'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:242:in `block in load'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:233:in `load_dependency'
/Users/maksar/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:242:in `load'
/Users/maksar/Projects/git/opener/bin/cucumber:7:in `<top (required)>'

Override options when running all features

How do people feel about an option similar to :run_all => { :cli => "-p" } which appears now in guard-rspec?

This allows you to set different options when running all features than you would use when running individual ones.

Readme addition for guard-spork (drb) support

The update to options[:cli] has removed the --require fixes to support guard-spork out of the box (from issue 3). I was in the process of submitting a pull request to add this back but realized that it would involve some parsing of options[:cli]. That feels borderline awkward and would need additional spec'ing to ensure the requires weren't added by the user explicitly.

So, I'd suggest that the README could use a note explaining how to get guard-cucumber and guard-spork working together. Here's the bare minimum that will work:

guard 'cucumber', :cli => '--drb --require features/support --require features/step_definitions' do
  # ...
end

Thanks for this plugin!

No errors displayed

I am learning BDD using cucumber. So any pointers regarding my dotfiles, approach are appreciated. My issues seems almost identical to this one. However I am unable to use this solution to solve my problem.

This is the output from my terminal:

Guard uses Libnotify to send notifications.
Guard is now watching at '/home/rhodee/GitRepos/projects/adelante'
Starting Spork for RSpec, Cucumber
Using Cucumber
Using RSpec
Preloading Rails environment
.../support/env.rb has not been bootstrapped.  Run spork --bootstrap to do so.
Loading Spork.prefork block...
Preloading Rails environment
Spork is ready and listening on 8990!
Spork is ready and listening on 8989!
Spork server for RSpec, Cucumber successfully started
Running all features
Disabling profiles...
UUU

1 scenario (1 undefined)
3 steps (3 undefined)
0m1.332s

I believe where the UUU string appears I should see my errors. I am able to see the errors when running bundle exec rake cucumber outside of Guard.

Gemfile:
group :development do
gem 'ffaker'
gem 'annotate', git: 'https://github.com/ctran/annotate_models.git'
gem 'libnotify'
gem 'guard-livereload'
gem 'guard-spork'
gem 'guard-cucumber'
gem 'spork', "~> 0.9.0.rc"
end

group :test do
gem 'rspec-rails', "> 2.7.0"
gem 'database_cleaner', "
> 0.7.0"
gem 'cucumber-rails', "> 1.2.1"
gem 'factory_girl_rails', "
> 1.4.0"
gem 'spork', "~> 0.9.0.rc"
end

The Guardfile contains:

guard 'spork' do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/..rb$})
watch(%r{^config/initializers/.
.rb$})
watch(%r{^spec/support/.+.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
watch(%r{features/support/}) { :cucumber }
watch('spec/spec_helper.rb')
end

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

guard 'livereload' do
watch(%r{app/.+.(erb|haml)})
watch(%r{app/helpers/.+.rb})
watch(%r{(public/|app/assets).+.(css|js|html)})
watch(%r{(app/assets/.+.css).s[ac]ss}) { |m| m[1] }
watch(%r{(app/assets/.+.js).coffee}) { |m| m[1] }
watch(%r{config/locales/.+.yml})
end

The error is on the playground branch of my repo adelante.

Cheers.

Running individual features in Spork doesn't load step definitions

Run using guard-spork and running individual features the step definitions aren't loaded, fix was to add a require to the cli options"

guard 'cucumber', :cli => "--drb --require features/step_definitions" do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$})                      { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }  
end

not sure if this needs a bugfix or just a note in the readme

It doesn't show the errors when :cli option is used

Hi there,

When i use :cli option (no matter what options i specify), guard hides the cucumber errors and shows a "Done." instead

Guardfile with :cli
guard 'cucumber', :change_format => 'pretty', :cli => "--drb"


restebanez@Rodrigo-Estebanez-MacBook-Pro:~/agi [develop] guard
Please install rb-fsevent gem for Mac OSX FSEvents support
Using polling (Please help us to support your system better than that).
Guard is now watching at '/Users/restebanez/agi'
Starting Spork for RSpec & Cucumber 
Using RSpec
Using Cucumber
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork is ready and listening on 8990!
Spork server for RSpec & Cucumber successfully started
Guard::RSpec is running, with RSpec 2!
Run Cucumber features features/app/app.feature
Using the default profile...
Running tests with args ["--require", "/Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/guard-cucumber-0.7.2/lib/guard/cucumber/notification_formatter.rb", "--format", "Guard::Cucumber::NotificationFormatter", "--out", "/dev/null", "--require", "features", "features/app/app.feature", "--format", "pretty", "--strict", "--tags", "~@wip", "--no-profile"]...
Disabling profiles...
Feature: Show App page
  As a user
  I want Agi to show me the configuration and status of an app

  Background:           # features/app/app.feature:5
    Given an app exists # features/step_definitions/pickle_steps.rb:4

  Scenario: Show an app that has never been deployed # features/app/app.feature:8
    And I go to the app show page                    # features/step_definitions/web_steps.rb:49
Done.

If i removed the :cli option in my Guardfile, it shows things correctly:


restebanez@Rodrigo-Estebanez-MacBook-Pro:~/agi [develop] guard
Please install rb-fsevent gem for Mac OSX FSEvents support
Using polling (Please help us to support your system better than that).
Guard is now watching at '/Users/restebanez/agi'
Starting Spork for RSpec & Cucumber 
Using RSpec
Using Cucumber
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork is ready and listening on 8990!
Spork server for RSpec & Cucumber successfully started
Guard::RSpec is running, with RSpec 2!
Run Cucumber features features/app/app.feature
Disabling profiles...
Feature: Show App page
  As a user
  I want Agi to show me the configuration and status of an app

  Background:           # features/app/app.feature:5
    Given an app exists # features/step_definitions/pickle_steps.rb:4

  Scenario: Show an app that has never been deployed # features/app/app.feature:8
    And I go to the app show page                    # features/step_definitions/web_steps.rb:49
      Could not figure out a path for ["the app"] {:extra=>"show"} (RuntimeError)
      ./features/support/paths.rb:41:in `path_to'
      ./features/step_definitions/web_steps.rb:50:in`/^(?:|I )go to (.+)$/'
      features/app/app.feature:9:in `And I go to the app show page'
    Then I should see "Undeployed changes" alert     # features/app/app.feature:10
      Undefined step: "I should see "Undeployed changes" alert" (Cucumber::Undefined)
      features/app/app.feature:10:in`Then I should see "Undeployed changes" alert'

Failing Scenarios:
cucumber features/app/app.feature:8 # Scenario: Show an app that has never been deployed

1 scenario (1 failed)
3 steps (1 failed, 1 undefined, 1 passed)
0m1.453s

You can implement step definitions for undefined steps with these snippets:

Then /^I should see "([^"]*)" alert$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.