From 217bb55774f2a1237638bc876e9578438025e25e Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 30 Jun 2011 23:56:32 -0400 Subject: [PATCH] better message --- lib/guard/puppet.rb | 5 +++-- spec/lib/guard/puppet_spec.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/guard/puppet.rb b/lib/guard/puppet.rb index da6307e..a826d24 100644 --- a/lib/guard/puppet.rb +++ b/lib/guard/puppet.rb @@ -15,10 +15,11 @@ module ::Guard UI.info(msg = "Applying Puppet configuration...") Notifier.notify msg, :title => "Puppet Config", :image => :pending if Runner.new(@options).run != 0 - Notifier.notify "Puppet config failure!", :title => "Puppet Config", :image => :failed + Notifier.notify(msg = "Puppet config failure!", :title => "Puppet Config", :image => :failed) else - Notifier.notify "Puppet config reapplied successfully!", :title => "Puppet Config" + Notifier.notify(msg = "Puppet config reapplied successfully!", :title => "Puppet Config") end + UI.info(msg) end def run_on_change(files = []) diff --git a/spec/lib/guard/puppet_spec.rb b/spec/lib/guard/puppet_spec.rb index d58f519..70993d6 100644 --- a/spec/lib/guard/puppet_spec.rb +++ b/spec/lib/guard/puppet_spec.rb @@ -6,7 +6,7 @@ describe Guard::Puppet do describe '#run_all' do before do - Guard::UI.expects(:info) + Guard::UI.stubs(:info) Guard::Notifier.expects(:notify).with("Applying Puppet configuration...", { :image => :pending, :title => "Puppet Config" }) Guard::Puppet::Runner.any_instance.expects(:run).returns(return_value) end