3

I get no Growl notifications when tests pass or fail. I've gone through all the setup guides I can find.

Details

I run guard and it starts Spork fine:

Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!

When I change a spec file, everything seems OK:

Running: spec/unit/category_spec.rb
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/John/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.2/lib/guard/rspec/formatters/notification_rspec.rb", "spec/unit/category_spec.rb"]...
.

Finished in 0.2063 seconds
1 example, 0 failures
Done.

But... nothing from Growl.

What I've Tried

  • Ticked Guard in the Applications tab in Growl pref pane
  • Installed latest Growl for Snow Leopard - V1.2.2
  • Growl is started and working OK - I enable iTerm and I get notifications from that fine.
  • Added rb-fsevent, growl and growl_notify to gem file and ran bundle install
  • Installed Growl Notify package from the Growl Downloads page.
  • Restarted my Mac

Gemfile

group :development, :test do
  gem 'factory_girl'
  gem 'rspec-rails'
  gem "guard-rspec"
  gem "spork", "> 0.9.0.rc"
  gem "guard-spork"
  gem 'rb-fsevent'
  gem 'growl_notify'
  gem 'growl'
end

Update

By complete chance I found that when I removed the --drb option from the guard file:

Before:

guard 'rspec', :version => 2, :cli => "--drb"  do

After:

guard 'rspec', :version => 2, :cli => ""  do

Growl started working. But when I do this, the tests take ages to run again.

Growl works OR tests are fast ...but not both!

John Gallagher
  • 6,208
  • 6
  • 40
  • 75

2 Answers2

0

I had to go to get growl notify to get it to work with my system. There are other options available, but I can't find the website or post that lists them. That was the easiest for me to setup. Growl notify is different than Growl.

Noah Clark
  • 8,101
  • 14
  • 74
  • 116
  • https://github.com/guard/guard-rspec/issues/60 discusses this issue and also https://github.com/scottdavis/growl_notify/issues/6 – Ivan -Oats- Storck Nov 11 '11 at 00:20
  • From what I read we're dealing with two different things. I am using the growl gem, but I had to install the growl notify software for it to work. My understanding is the growl notify allows the CLI to activate growl. Is this not the case? – Noah Clark Nov 11 '11 at 00:26
  • I've downloaded the Growl Notify package and installed it, but I'm already using the growl_notify gem. Either way I still get nothing when the tests run again. Everything seems to be fine, Growl just doesn't show anything when a test fails/passes. – John Gallagher Nov 11 '11 at 19:12
0

Finally, the penny dropped, completely by accident.

I had the following line in my Guardfile:

guard 'rspec', :version => 2, :cli => "--drb" do
    ....
end

The problem was the --drb switch - once I removed it, all was well:

guard 'rspec', :version => 2, :cli => "" do
    ....
end

Now Growl notifies me immediately when tests pass/fail. Hurrah!

John Gallagher
  • 6,208
  • 6
  • 40
  • 75
  • The only problem now is that the tests take ages to run again, presumably because rspec isn't running using the --drb option and not finding spork. This is so irritating - it looks like I can get Growl working OR I can have fast tests, but not both! – John Gallagher Nov 14 '11 at 11:38
  • 1
    Did you ever find a solution to this? I have exactly the same problem - very annoying! – Craig McGuff Dec 13 '11 at 22:29
  • 1
    Nope. Still using it with fast tests and no Growl notifications. It is indeed *very* annoying! – John Gallagher Dec 15 '11 at 11:10
  • Well, I finally fixed this on my machine, but not the way I wanted to. Updated to OSX Lion and paid for growl so I could install growlnotify. worked first time. – Craig McGuff Apr 18 '12 at 05:04