commit
bebaef1592
@ -181,6 +181,9 @@ module Guard
|
|||||||
end
|
end
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
require 'growl'
|
require 'growl'
|
||||||
|
rescue ::GrowlNotify::GrowlNotFound
|
||||||
|
turn_off
|
||||||
|
UI.info "Please install Growl from http://growl.info"
|
||||||
end
|
end
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
turn_off
|
turn_off
|
||||||
|
@ -21,10 +21,20 @@ describe Guard::Notifier do
|
|||||||
|
|
||||||
context "with the GrowlNotify library available" do
|
context "with the GrowlNotify library available" do
|
||||||
before do
|
before do
|
||||||
module ::GrowlNotify
|
class ::GrowlNotify
|
||||||
|
class GrowlNotFound < Exception; end
|
||||||
def self.config ; end
|
def self.config ; end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should respond properly to a GrowlNotify exception" do
|
||||||
|
::GrowlNotify.should_receive(:config).and_raise ::GrowlNotify::GrowlNotFound
|
||||||
|
::GrowlNotify.should_receive(:application_name).and_return ''
|
||||||
|
::Guard::UI.should_receive(:info)
|
||||||
|
described_class.should_receive(:require).with('growl_notify').and_return true
|
||||||
|
described_class.turn_on
|
||||||
|
described_class.should_not be_enabled
|
||||||
|
end
|
||||||
|
|
||||||
it "loads the library and enables the notifications" do
|
it "loads the library and enables the notifications" do
|
||||||
described_class.should_receive(:require).with('growl_notify').and_return true
|
described_class.should_receive(:require).with('growl_notify').and_return true
|
||||||
|
Loading…
Reference in New Issue
Block a user