Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
require 'spec_helper' | ||
require 'ruby-growl' | ||
|
||
describe UniformNotifier::Growl do | ||
|
||
it "should notify growl without password" do | ||
growl = double('growl') | ||
Growl.should_receive(:new).with('localhost', 'uniform_notifier', ['uniform_notifier'], nil, nil).and_return(growl) | ||
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered | ||
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl without password').ordered | ||
|
||
UniformNotifier.growl = true | ||
p UniformNotifier::Growl.out_of_channel_notify('notify growl without password').methods.sort | ||
UniformNotifier::Growl.out_of_channel_notify('notify growl without password') | ||
end | ||
|
||
it "should notify growl with password" do | ||
growl = double('growl') | ||
Growl.should_receive(:new).with('localhost', 'uniform_notifier', ['uniform_notifier'], nil, '123456').and_return(growl) | ||
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered | ||
growl.should_receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl with password').ordered | ||
|
||
UniformNotifier.growl = { :password => '123456' } | ||
UniformNotifier::Growl.out_of_channel_notify('notify growl with password') | ||
end | ||
end | ||
end |