Skip to content

Commit b703327

Browse files
committed
allow notifier to work w/wo guard
1 parent 94fb29c commit b703327

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/guard/cucumber/notification_formatter.rb

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Conditionally require this because it's run outside Guard
2-
# TODO: MOVE THIS OUTSIDE THE FORMATTER!!!!
3-
require "guard/notifier"
2+
#
3+
if Object.const_defined?(:Guard)
4+
# TODO: MOVE THIS OUTSIDE THE FORMATTER!!!!
5+
# TODO: (call notify() in Guard::Cucumber, not here in formatter
6+
7+
# If notifier is defined it's likely Guard::Compat::Plugin's stub
8+
unless Guard.const_defined?(:Notifier)
9+
require "guard"
10+
require "guard/notifier"
11+
end
12+
end
413

514
require "cucumber"
615
require "guard/compat/plugin"

0 commit comments

Comments
 (0)