Skip to content

Commit

Permalink
Set the default notifier right away.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Apr 30, 2014
1 parent 5fb8109 commit d2f3ec4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -8,8 +8,8 @@ GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.2.5)
notifier (0.4.1)
rake (10.2.2)
notifier (0.5.0)
rake (10.3.1)
rspec (3.0.0.beta2)
rspec-core (= 3.0.0.beta2)
rspec-expectations (= 3.0.0.beta2)
Expand Down
7 changes: 5 additions & 2 deletions lib/test_notifier.rb
Expand Up @@ -2,7 +2,7 @@

module TestNotifier
class << self
attr_accessor :default_notifier, :silence_no_notifier_warning
attr_accessor :silence_no_notifier_warning
end

extend self
Expand All @@ -27,6 +27,10 @@ class << self
:error => "red"
}

def default_notifier=(notifier)
Notifier.default_notifier = notifier
end

def notify(options)
options.merge!({
:title => TITLES[options[:status]],
Expand All @@ -38,7 +42,6 @@ def notify(options)
end

def notifier
Notifier.default_notifier = default_notifier
notifier = Notifier.notifier

if notifier == Notifier::Placebo && !silence_no_notifier_warning
Expand Down

0 comments on commit d2f3ec4

Please sign in to comment.