netzpirat / guard-cucumber

Guard::Cucumber automatically runs your features (much like autotest)

Home Page:https://rubygems.org/gems/guard-cucumber

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

growl is not working

chabgood opened this issue · comments

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.

Sorry, error is:
Running all features
Disabling profiles...

0 scenarios
0 steps
0m0.000s
CommandError
OSERROR: 3
MESSAGE: 'image from URL' parameter - Badly formed path.
COMMAND: app("/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").notify({:title=>"Cucumber Results", :application_name=>"Guard", :description=>"", :sticky=>false, :priority=>0, :with_name=>"Guard", :image_from_location=>""})
(Appscript::CommandError)
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in _send_command' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/rb-appscript-0.6.1/lib/appscript.rb:642:inmethod_missing'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/growl_notify-0.0.1/lib/growl_notify.rb:36:in send_notification' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-0.6.3/lib/guard/notifier.rb:58:innotify_mac'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-0.6.3/lib/guard/notifier.rb:32:in notify' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-cucumber-0.6.1/lib/guard/cucumber/notification_formatter.rb:56:innotify_summary'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-cucumber-0.6.1/lib/guard/cucumber/notification_formatter.rb:20:in after_features' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:173:inblock in send_to_all'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:171:in each' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:171:insend_to_all'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:164:in broadcast' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:13:invisit_features'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:45:in run!' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:43:inexecute!'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:20:in execute' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/bin/cucumber:14:in<top (required)>'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/bin/cucumber:19:in load' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/bin/cucumber:19:in

'

Can you please give some more details about the exception? In general the growl notifications are done in Guard and both, guard-cucumber and guard-rspec, use the functionality through the same API.

FYI: I just added a wiki page to Guard that deals with problems we're seeing with growl_notify. Please share your findings there also.

The error was the complete error generated. Here is my gemfile, not using spork:
source 'http://rubygems.org'

gem 'rails', '3.1.0.rc8'

group :assets do
gem 'sass-rails', "> 3.1.0.rc"
gem 'coffee-rails', "
> 3.1.0.rc"
gem 'uglifier'
end

gem 'jquery-rails'
gem "mongo_mapper", :path => "/Volumes/Backup/git_working/food_for_thought/web/vendor/gems/mongomapper"

group :development, :test do
gem "nifty-generators", :group => :development
gem "rspec-rails", ">= 2.6.1"
gem "factory_girl_rails", ">= 1.1.0"
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'guard-rspec'
gem 'guard-cucumber'
gem 'guard-livereload'
gem "cucumber-rails", ">= 1.0.2"
gem "capybara", ">= 1.0.0"
gem "database_cleaner", ">= 0.6.7"
gem "launchy", ">= 2.0.5"
gem "bson_ext"
gem 'turn', :require => false
gem 'growl_notify'
end

The problem is that the image is empty, so this means that there is an unknown status passed to icon_for. I just checked the Cucumber sources and can't find any new status.

So can you please analyze what status is passed to icon_for? Just call

bundle open guard-cucumber

and your editor will open with the current guard-cucumber sources. Now go to line 65 and simply add the following line at the top of the icon_for method:

puts status, status.class

Now run your features and report your findings.

I think it is erroring prior to that call, I am not seeing any output:

Running all features
Disabling profiles...

0 scenarios
0 steps
0m0.000s
CommandError
OSERROR: 3
MESSAGE: 'image from URL' parameter - Badly formed path.
COMMAND:
app("/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").notify({:title=>"Cucumber
Results", :application_name=>"Guard", :description=>"", :sticky=>false,
:priority=>0, :with_name=>"Guard", :image_from_location=>""})
(Appscript::CommandError)
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in
_send_command' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in method_missing'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/growl_notify-0.0.1/lib/growl_notify.rb:36:in
send_notification' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-0.6.3/lib/guard/notifier.rb:58:in notify_mac'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-0.6.3/lib/guard/notifier.rb:32:in
notify' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-cucumber-0.6.1/lib/guard/cucumber/notification_formatter.rb:56:in notify_summary'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/guard-cucumber-0.6.1/lib/guard/cucumber/notification_formatter.rb:20:in
after_features' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:173:in block in send_to_all'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:171:in
each' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:171:in send_to_all'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:164:in
broadcast' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:13:in visit_features'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:45:in
run!' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:43:in execute!'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:20:in
execute' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/gems/cucumber-1.0.2/bin/cucumber:14:in <top (required)>'
/Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/bin/cucumber:19:in
load' /Users/chabgood/.rvm/gems/ruby-1.9.2-p136@food_for_thought/bin/cucumber:19:in

'

On Sun, Sep 4, 2011 at 07:04, netzpirat <
reply@reply.github.com>wrote:

The problem is that the image is empty, so this means that there is an
unknown status passed to icon_for.
I just checked the Cucumber sources and can't find any new status.

So can you please analyze what status is passed to icon_for? Just call

bundle open guard-cucumber

and your editor will open with the current guard-cucumber sources. Now go
to line 65 and simply add the following line at the top of the icon_for
method:

puts status, status.class

Now run your features and report your findings.

Reply to this email directly or view it on GitHub:
#17 (comment)

*"In matters of style, swim with the current; in matters of principle, stand
like a rock."
Thomas Jefferson
*

Seeing that exception again I finally understand the problem. Released 0.6.2 that contains the bugfix. Thanks a lot.

Awesome, it works now, thanks. What did you change?

On Sun, Sep 4, 2011 at 13:08, netzpirat <
reply@reply.github.com>wrote:

Seeing that exception again I finally understand the problem. Released
0.6.2 that contains the bugfix. Thanks a lot.

Reply to this email directly or view it on GitHub:
#17 (comment)

*"In matters of style, swim with the current; in matters of principle, stand
like a rock."
Thomas Jefferson
*

I had a logic error that may lead to an empty image name and that caused growl_notify to throw an error. I fixed it by making sure that only a valid image symbol or nil is passed to Guard.