uniform_notifier 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Gemfile +3 -1
- data/README.md +18 -1
- data/Rakefile +13 -11
- data/lib/uniform_notifier.rb +8 -7
- data/lib/uniform_notifier/airbrake.rb +2 -0
- data/lib/uniform_notifier/base.rb +17 -14
- data/lib/uniform_notifier/bugsnag.rb +5 -3
- data/lib/uniform_notifier/customized_logger.rb +6 -4
- data/lib/uniform_notifier/errors.rb +3 -1
- data/lib/uniform_notifier/growl.rb +23 -20
- data/lib/uniform_notifier/honeybadger.rb +2 -0
- data/lib/uniform_notifier/javascript_alert.rb +7 -3
- data/lib/uniform_notifier/javascript_console.rb +18 -14
- data/lib/uniform_notifier/rails_logger.rb +3 -1
- data/lib/uniform_notifier/raise.rb +3 -1
- data/lib/uniform_notifier/rollbar.rb +2 -0
- data/lib/uniform_notifier/sentry.rb +2 -0
- data/lib/uniform_notifier/slack.rb +20 -19
- data/lib/uniform_notifier/terminal_notifier.rb +23 -0
- data/lib/uniform_notifier/version.rb +3 -1
- data/lib/uniform_notifier/xmpp.rb +26 -23
- data/spec/spec_helper.rb +8 -6
- data/spec/uniform_notifier/airbrake_spec.rb +12 -10
- data/spec/uniform_notifier/base_spec.rb +10 -8
- data/spec/uniform_notifier/bugsnag_spec.rb +21 -19
- data/spec/uniform_notifier/customized_logger_spec.rb +9 -7
- data/spec/uniform_notifier/growl_spec.rb +19 -18
- data/spec/uniform_notifier/honeybadger_spec.rb +12 -10
- data/spec/uniform_notifier/javascript_alert_spec.rb +29 -9
- data/spec/uniform_notifier/javascript_console_spec.rb +55 -17
- data/spec/uniform_notifier/rails_logger_spec.rb +9 -7
- data/spec/uniform_notifier/raise_spec.rb +13 -11
- data/spec/uniform_notifier/rollbar_spec.rb +8 -6
- data/spec/uniform_notifier/sentry_spec.rb +12 -10
- data/spec/uniform_notifier/slack_spec.rb +10 -8
- data/spec/uniform_notifier/terminal_notifier_spec.rb +25 -0
- data/spec/uniform_notifier/xmpp_spec.rb +17 -15
- data/uniform_notifier.gemspec +18 -17
- metadata +6 -3
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class UniformNotifier
|
2
4
|
class RailsLogger < Base
|
3
5
|
def self.active?
|
@@ -6,7 +8,7 @@ class UniformNotifier
|
|
6
8
|
|
7
9
|
protected
|
8
10
|
|
9
|
-
def self._out_of_channel_notify(
|
11
|
+
def self._out_of_channel_notify(data)
|
10
12
|
message = data.values.compact.join("\n")
|
11
13
|
|
12
14
|
Rails.logger.warn message
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class UniformNotifier
|
2
4
|
class Raise < Base
|
3
5
|
def self.active?
|
@@ -10,7 +12,7 @@ class UniformNotifier
|
|
10
12
|
|
11
13
|
protected
|
12
14
|
|
13
|
-
def self._out_of_channel_notify(
|
15
|
+
def self._out_of_channel_notify(data)
|
14
16
|
message = data.values.compact.join("\n")
|
15
17
|
|
16
18
|
raise @exception_class, message
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class UniformNotifier
|
2
4
|
class Slack < Base
|
3
|
-
POSSIBLE_OPTIONS = [
|
5
|
+
POSSIBLE_OPTIONS = %i[username channel].freeze
|
4
6
|
|
5
7
|
@slack = nil
|
6
8
|
|
@@ -9,7 +11,7 @@ class UniformNotifier
|
|
9
11
|
@slack
|
10
12
|
end
|
11
13
|
|
12
|
-
def setup_connection(config={})
|
14
|
+
def setup_connection(config = {})
|
13
15
|
webhook_url, options = parse_config(config)
|
14
16
|
fail_connection('webhook_url required for Slack notification') unless webhook_url
|
15
17
|
|
@@ -22,30 +24,29 @@ class UniformNotifier
|
|
22
24
|
|
23
25
|
protected
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
def _out_of_channel_notify(data)
|
28
|
+
message = data.values.compact.join("\n")
|
29
|
+
notify(message)
|
30
|
+
end
|
29
31
|
|
30
32
|
private
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
def notify(message)
|
38
|
-
@slack.ping message
|
39
|
-
end
|
34
|
+
def fail_connection(message)
|
35
|
+
@slack = nil
|
36
|
+
raise NotificationError, message
|
37
|
+
end
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
39
|
+
def notify(message)
|
40
|
+
@slack.ping message
|
41
|
+
end
|
45
42
|
|
46
|
-
|
43
|
+
def parse_config(config)
|
44
|
+
options = config.select do |name, value|
|
45
|
+
POSSIBLE_OPTIONS.include?(name) && !value.nil?
|
47
46
|
end
|
48
47
|
|
48
|
+
[config[:webhook_url], options]
|
49
|
+
end
|
49
50
|
end
|
50
51
|
end
|
51
52
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class UniformNotifier
|
4
|
+
class TerminalNotifier < Base
|
5
|
+
def self.active?
|
6
|
+
!!UniformNotifier.terminal_notifier
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
|
11
|
+
def self._out_of_channel_notify(data)
|
12
|
+
unless defined?(::TerminalNotifier)
|
13
|
+
begin
|
14
|
+
require 'terminal-notifier'
|
15
|
+
rescue LoadError
|
16
|
+
raise NotificationError, 'You must install the terminal-notifier gem to use terminal_notifier: `gem install terminal-notifier`'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
::TerminalNotifier.notify(data[:body], title: data[:title])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class UniformNotifier
|
2
4
|
class Xmpp < Base
|
3
5
|
@receiver = nil
|
@@ -8,7 +10,7 @@ class UniformNotifier
|
|
8
10
|
@xmpp
|
9
11
|
end
|
10
12
|
|
11
|
-
def self.setup_connection(
|
13
|
+
def self.setup_connection(xmpp_information)
|
12
14
|
return unless xmpp_information
|
13
15
|
|
14
16
|
require 'xmpp4r'
|
@@ -23,36 +25,37 @@ class UniformNotifier
|
|
23
25
|
connect if @stay_connected
|
24
26
|
rescue LoadError
|
25
27
|
@xmpp = nil
|
26
|
-
raise NotificationError
|
28
|
+
raise NotificationError, 'You must install the xmpp4r gem to use XMPP notification: `gem install xmpp4r`'
|
27
29
|
end
|
28
30
|
|
29
31
|
protected
|
30
32
|
|
31
|
-
def self._out_of_channel_notify(
|
33
|
+
def self._out_of_channel_notify(data)
|
32
34
|
message = data.values.compact.join("\n")
|
33
35
|
|
34
|
-
notify(
|
36
|
+
notify(message)
|
35
37
|
end
|
36
38
|
|
37
39
|
private
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
40
|
+
|
41
|
+
def self.connect
|
42
|
+
jid = Jabber::JID.new(@account)
|
43
|
+
@xmpp = Jabber::Client.new(jid)
|
44
|
+
@xmpp.connect
|
45
|
+
@xmpp.auth(@password)
|
46
|
+
@xmpp.send(presence_status) if @show_online_status
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.notify(message)
|
50
|
+
connect unless @stay_connected
|
51
|
+
message = Jabber::Message.new(@receiver, message)
|
52
|
+
.set_type(:normal)
|
53
|
+
.set_subject('Uniform Notifier')
|
54
|
+
@xmpp.send(message)
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.presence_status
|
58
|
+
Jabber::Presence.new.set_status("Uniform Notifier started on #{Time.now}")
|
59
|
+
end
|
57
60
|
end
|
58
61
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
|
5
|
+
require 'uniform_notifier'
|
6
|
+
require 'ruby-growl'
|
7
|
+
require 'xmpp4r'
|
8
|
+
require 'slack-notifier'
|
9
|
+
require 'rspec'
|
@@ -1,25 +1,27 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
2
4
|
|
3
5
|
class Airbrake
|
4
6
|
# mock Airbrake
|
5
7
|
end
|
6
8
|
|
7
9
|
RSpec.describe UniformNotifier::AirbrakeNotifier do
|
8
|
-
it
|
9
|
-
expect(UniformNotifier::AirbrakeNotifier.out_of_channel_notify(:
|
10
|
+
it 'should not notify airbrake' do
|
11
|
+
expect(UniformNotifier::AirbrakeNotifier.out_of_channel_notify(title: 'notify airbrake')).to be_nil
|
10
12
|
end
|
11
13
|
|
12
|
-
it
|
13
|
-
expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new(
|
14
|
+
it 'should notify airbrake' do
|
15
|
+
expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new('notify airbrake'), {})
|
14
16
|
|
15
17
|
UniformNotifier.airbrake = true
|
16
|
-
UniformNotifier::AirbrakeNotifier.out_of_channel_notify(:
|
18
|
+
UniformNotifier::AirbrakeNotifier.out_of_channel_notify(title: 'notify airbrake')
|
17
19
|
end
|
18
20
|
|
19
|
-
it
|
20
|
-
expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new(
|
21
|
+
it 'should notify airbrake' do
|
22
|
+
expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new('notify airbrake'), foo: :bar)
|
21
23
|
|
22
|
-
UniformNotifier.airbrake = { :
|
23
|
-
UniformNotifier::AirbrakeNotifier.out_of_channel_notify(
|
24
|
+
UniformNotifier.airbrake = { foo: :bar }
|
25
|
+
UniformNotifier::AirbrakeNotifier.out_of_channel_notify('notify airbrake')
|
24
26
|
end
|
25
27
|
end
|
@@ -1,22 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
RSpec.describe UniformNotifier::Base do
|
4
|
-
context
|
6
|
+
context '#inline_channel_notify' do
|
5
7
|
before do
|
6
8
|
allow(UniformNotifier::Base).to receive(:active?).and_return(true)
|
7
9
|
end
|
8
|
-
it
|
9
|
-
expect(UniformNotifier::Base).to receive(:_inline_notify).once.with(:
|
10
|
-
UniformNotifier::Base.inline_notify(
|
10
|
+
it 'should keep the compatibility' do
|
11
|
+
expect(UniformNotifier::Base).to receive(:_inline_notify).once.with(title: 'something')
|
12
|
+
UniformNotifier::Base.inline_notify('something')
|
11
13
|
end
|
12
14
|
end
|
13
|
-
context
|
15
|
+
context '#out_of_channel_notify' do
|
14
16
|
before do
|
15
17
|
allow(UniformNotifier::Base).to receive(:active?).and_return(true)
|
16
18
|
end
|
17
|
-
it
|
18
|
-
expect(UniformNotifier::Base).to receive(:_out_of_channel_notify).once.with(:
|
19
|
-
UniformNotifier::Base.out_of_channel_notify(
|
19
|
+
it 'should keep the compatibility' do
|
20
|
+
expect(UniformNotifier::Base).to receive(:_out_of_channel_notify).once.with(title: 'something')
|
21
|
+
UniformNotifier::Base.out_of_channel_notify('something')
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
2
4
|
|
3
5
|
class Bugsnag
|
4
6
|
# mock Bugsnag
|
@@ -6,51 +8,51 @@ end
|
|
6
8
|
|
7
9
|
RSpec.describe UniformNotifier::BugsnagNotifier do
|
8
10
|
let(:notification_data) { {} }
|
9
|
-
it
|
11
|
+
it 'should not notify bugsnag' do
|
10
12
|
expect(Bugsnag).not_to receive(:notify)
|
11
13
|
UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
|
12
14
|
end
|
13
|
-
context
|
14
|
-
let(:notification_data) { {:
|
15
|
+
context 'with string notification' do
|
16
|
+
let(:notification_data) { { user: 'user', title: 'notify bugsnag', url: 'URL', body: 'something' } }
|
15
17
|
|
16
|
-
it
|
17
|
-
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(notification_data[:title]), :
|
18
|
+
it 'should notify bugsnag' do
|
19
|
+
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(notification_data[:title]), grouping_hash: notification_data[:body], notification: notification_data)
|
18
20
|
|
19
21
|
UniformNotifier.bugsnag = true
|
20
22
|
UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
|
21
23
|
end
|
22
24
|
|
23
|
-
it
|
24
|
-
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(notification_data[:title]), :
|
25
|
+
it 'should notify bugsnag with option' do
|
26
|
+
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(notification_data[:title]), foo: :bar, grouping_hash: notification_data[:body], notification: notification_data)
|
25
27
|
|
26
|
-
UniformNotifier.bugsnag = { :
|
28
|
+
UniformNotifier.bugsnag = { foo: :bar }
|
27
29
|
UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
|
28
30
|
end
|
29
31
|
end
|
30
|
-
context
|
31
|
-
let(:notification_data) {
|
32
|
+
context 'with hash notification' do
|
33
|
+
let(:notification_data) { 'notify bugsnag' }
|
32
34
|
|
33
|
-
it
|
34
|
-
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(
|
35
|
+
it 'should notify bugsnag' do
|
36
|
+
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new('notify bugsnag'), grouping_hash: 'notify bugsnag', notification: { title: 'notify bugsnag' })
|
35
37
|
|
36
38
|
UniformNotifier.bugsnag = true
|
37
39
|
UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
|
38
40
|
end
|
39
41
|
|
40
|
-
it
|
41
|
-
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new(
|
42
|
+
it 'should notify bugsnag with option' do
|
43
|
+
expect(Bugsnag).to receive(:notify).with(UniformNotifier::Exception.new('notify bugsnag'), foo: :bar, grouping_hash: 'notify bugsnag', notification: { title: 'notify bugsnag' })
|
42
44
|
|
43
|
-
UniformNotifier.bugsnag = { :
|
45
|
+
UniformNotifier.bugsnag = { foo: :bar }
|
44
46
|
UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
it
|
50
|
+
it 'should notify bugsnag with correct backtrace' do
|
49
51
|
expect(Bugsnag).to receive(:notify) do |error|
|
50
52
|
expect(error).to be_a UniformNotifier::Exception
|
51
|
-
expect(error.backtrace).to eq [
|
53
|
+
expect(error.backtrace).to eq ['bugsnag spec test']
|
52
54
|
end
|
53
55
|
UniformNotifier.bugsnag = true
|
54
|
-
UniformNotifier::BugsnagNotifier.out_of_channel_notify(backtrace: [
|
56
|
+
UniformNotifier::BugsnagNotifier.out_of_channel_notify(backtrace: ['bugsnag spec test'])
|
55
57
|
end
|
56
58
|
end
|
@@ -1,21 +1,23 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
2
4
|
|
3
5
|
RSpec.describe UniformNotifier::CustomizedLogger do
|
4
|
-
it
|
5
|
-
expect(UniformNotifier::CustomizedLogger.out_of_channel_notify(:
|
6
|
+
it 'should not notify to customized logger' do
|
7
|
+
expect(UniformNotifier::CustomizedLogger.out_of_channel_notify(title: 'notify rails logger')).to be_nil
|
6
8
|
end
|
7
9
|
|
8
|
-
it
|
9
|
-
logger = File.open(
|
10
|
+
it 'should notify to customized logger' do
|
11
|
+
logger = File.open('test.log', 'a+')
|
10
12
|
logger.sync = true
|
11
13
|
|
12
14
|
now = Time.now
|
13
15
|
allow(Time).to receive(:now).and_return(now)
|
14
16
|
UniformNotifier.customized_logger = logger
|
15
|
-
UniformNotifier::CustomizedLogger.out_of_channel_notify(:
|
17
|
+
UniformNotifier::CustomizedLogger.out_of_channel_notify(title: 'notify rails logger')
|
16
18
|
|
17
19
|
logger.seek(0)
|
18
|
-
expect(logger.read).to eq "#{now.strftime(
|
20
|
+
expect(logger.read).to eq "#{now.strftime('%Y-%m-%d %H:%M:%S')}[WARN] notify rails logger"
|
19
21
|
|
20
22
|
File.delete('test.log')
|
21
23
|
end
|
@@ -1,13 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
RSpec.describe UniformNotifier::Growl do
|
4
|
-
|
5
|
-
|
6
|
-
expect(UniformNotifier::Growl.out_of_channel_notify(:title => 'notify growl')).to be_nil
|
6
|
+
it 'should not notify growl' do
|
7
|
+
expect(UniformNotifier::Growl.out_of_channel_notify(title: 'notify growl')).to be_nil
|
7
8
|
end
|
8
9
|
|
9
|
-
it
|
10
|
-
growl = double('growl',
|
10
|
+
it 'should notify growl without password' do
|
11
|
+
growl = double('growl', is_a?: true)
|
11
12
|
expect(Growl).to receive(:new).with('localhost', 'uniform_notifier').and_return(growl)
|
12
13
|
expect(growl).to receive(:add_notification).with('uniform_notifier')
|
13
14
|
expect(growl).to receive(:password=).with(nil)
|
@@ -15,42 +16,42 @@ RSpec.describe UniformNotifier::Growl do
|
|
15
16
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl without password').ordered
|
16
17
|
|
17
18
|
UniformNotifier.growl = true
|
18
|
-
UniformNotifier::Growl.out_of_channel_notify(:
|
19
|
+
UniformNotifier::Growl.out_of_channel_notify(title: 'notify growl without password')
|
19
20
|
end
|
20
21
|
|
21
|
-
it
|
22
|
-
growl = double('growl',
|
22
|
+
it 'should notify growl with password' do
|
23
|
+
growl = double('growl', is_a?: true)
|
23
24
|
expect(Growl).to receive(:new).with('localhost', 'uniform_notifier').and_return(growl)
|
24
25
|
expect(growl).to receive(:add_notification).with('uniform_notifier')
|
25
26
|
expect(growl).to receive(:password=).with('123456')
|
26
27
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered
|
27
28
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl with password').ordered
|
28
29
|
|
29
|
-
UniformNotifier.growl = { :
|
30
|
-
UniformNotifier::Growl.out_of_channel_notify(:
|
30
|
+
UniformNotifier.growl = { password: '123456' }
|
31
|
+
UniformNotifier::Growl.out_of_channel_notify(title: 'notify growl with password')
|
31
32
|
end
|
32
33
|
|
33
|
-
it
|
34
|
-
growl = double('growl',
|
34
|
+
it 'should notify growl with host' do
|
35
|
+
growl = double('growl', is_a?: true)
|
35
36
|
expect(Growl).to receive(:new).with('10.10.156.17', 'uniform_notifier').and_return(growl)
|
36
37
|
expect(growl).to receive(:add_notification).with('uniform_notifier')
|
37
38
|
expect(growl).to receive(:password=).with('123456')
|
38
39
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on').ordered
|
39
40
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl with password').ordered
|
40
41
|
|
41
|
-
UniformNotifier.growl = { :
|
42
|
-
UniformNotifier::Growl.out_of_channel_notify(:
|
42
|
+
UniformNotifier.growl = { password: '123456', host: '10.10.156.17' }
|
43
|
+
UniformNotifier::Growl.out_of_channel_notify(title: 'notify growl with password')
|
43
44
|
end
|
44
45
|
|
45
|
-
it
|
46
|
-
growl = double('growl',
|
46
|
+
it 'should notify growl with quiet' do
|
47
|
+
growl = double('growl', is_a?: true)
|
47
48
|
expect(Growl).to receive(:new).with('localhost', 'uniform_notifier').and_return(growl)
|
48
49
|
expect(growl).to receive(:add_notification).with('uniform_notifier')
|
49
50
|
expect(growl).to receive(:password=).with('123456')
|
50
51
|
expect(growl).not_to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'Uniform Notifier Growl has been turned on')
|
51
52
|
expect(growl).to receive(:notify).with('uniform_notifier', 'Uniform Notifier', 'notify growl with password')
|
52
53
|
|
53
|
-
UniformNotifier.growl = { :
|
54
|
-
UniformNotifier::Growl.out_of_channel_notify(:
|
54
|
+
UniformNotifier.growl = { password: '123456', quiet: true }
|
55
|
+
UniformNotifier::Growl.out_of_channel_notify(title: 'notify growl with password')
|
55
56
|
end
|
56
57
|
end
|