From 5c1e264c391011c520443c575d802cdc8839a544 Mon Sep 17 00:00:00 2001 From: Nick Sieger Date: Fri, 6 May 2011 12:09:00 -0500 Subject: [PATCH] Fix spec on JRuby that was failing due to different execution order --- lib/guard/notifier.rb | 4 ++++ spec/guard/notifier_spec.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/guard/notifier.rb b/lib/guard/notifier.rb index d250a22..52204e2 100644 --- a/lib/guard/notifier.rb +++ b/lib/guard/notifier.rb @@ -8,6 +8,10 @@ module Guard @disable = true end + def self.turn_on + @disable = nil + end + def self.notify(message, options = {}) unless @disable || ENV["GUARD_ENV"] == "test" image = options[:image] || :success diff --git a/spec/guard/notifier_spec.rb b/spec/guard/notifier_spec.rb index b12781b..603d05b 100644 --- a/spec/guard/notifier_spec.rb +++ b/spec/guard/notifier_spec.rb @@ -7,6 +7,7 @@ describe Guard::Notifier do before(:each) do @saved_guard_env = ENV["GUARD_ENV"] ENV["GUARD_ENV"] = 'dont_mute_notify' + subject.turn_on end if mac?