Skip to content

Commit 2fc209e

Browse files
committed
workaround for guard-minitest notify issue
1 parent 8176bd8 commit 2fc209e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/guard/compat/plugin.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,16 @@ def self.deprecation(message, options = {})
108108
end
109109
end
110110

111-
def self.notify(message, options = {})
112-
if Guard.const_defined?(:UI)
113-
Guard::Notifier.notify(message, options)
114-
else
115-
$stdout.puts(message)
116-
end
111+
def self.notify(msg, options = {})
112+
return $stdout.puts(msg) unless Guard.const_defined?(:UI)
113+
return Notifier.notify(msg, options) if Notifier.respond_to?(:notify)
114+
115+
# test helper was included
116+
note = 'NOTE: Notification is disabled when testing Guard plugins'\
117+
' (it makes no sense)'
118+
119+
$stderr.puts(note)
120+
$stdout.puts(msg)
117121
end
118122
end
119123
end

0 commit comments

Comments
 (0)