notifiers 1.2.1 → 2.0.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.
@@ -1,113 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Notifiers
4
- describe Growl do
5
- it_should_behave_like 'a notifier'
6
-
7
- before do
8
- @growl = growl
9
- end
10
-
11
- describe '#image' do
12
- it "should keep the image" do
13
- @growl.image('my_image.png')
14
- expect(@growl.instance_variable_get(:@image)).to eql 'my_image.png'
15
- end
16
-
17
- it "should set the image" do
18
- @growl.image('wario.png')
19
- expect(@growl.instance_variable_get(:@image)).to eql 'wario.png'
20
- end
21
- end
22
-
23
- describe '#message' do
24
- it "should set the message option" do
25
- @growl.message('Hello World!')
26
- expect(@growl.instance_variable_get(:@message)).to eql 'Hello World!'
27
- end
28
-
29
- it "should set the message" do
30
- @growl.message('May the Force be with you')
31
- expect(@growl.instance_variable_get(:@message)).to eql 'May the Force be with you'
32
- end
33
- end
34
-
35
- describe '#title' do
36
- it "should set the title" do
37
- @growl.title('Nirvana')
38
- expect(@growl.instance_variable_get(:@title)).to eql 'Nirvana'
39
- end
40
-
41
- it "should set the title option" do
42
- @growl.title('Pearl Jam')
43
- expect(@growl.instance_variable_get(:@title)).to eql 'Pearl Jam'
44
- end
45
- end
46
-
47
- describe '#priority' do
48
- it "should set the priority" do
49
- @growl.priority(0)
50
- expect(@growl.instance_variable_get(:@priority)).to be 0
51
- end
52
-
53
- it "should set the priority number" do
54
- @growl.priority(1)
55
- expect(@growl.instance_variable_get(:@priority)).to be 1
56
- end
57
- end
58
-
59
- describe '#host' do
60
- it "should set the hostname" do
61
- @growl.host('localhost')
62
- expect(@growl.instance_variable_get(:@host)).to eql 'localhost'
63
- end
64
-
65
- it "should set the host" do
66
- @growl.host('beer_duff.com')
67
- expect(@growl.instance_variable_get(:@host)).to eql 'beer_duff.com'
68
- end
69
- end
70
-
71
- describe '#password' do
72
- it "should set the password" do
73
- @growl.password('top_secret')
74
- expect(@growl.instance_variable_get(:@password)).to eql 'top_secret'
75
- end
76
-
77
- it "should set the secret password" do
78
- @growl.password('paradise_city')
79
- expect(@growl.instance_variable_get(:@password)).to eql 'paradise_city'
80
- end
81
- end
82
-
83
- describe '#auth' do
84
- it "should set the auth option" do
85
- @growl.auth('SHA256')
86
- expect(@growl.instance_variable_get(:@auth)).to eql 'SHA256'
87
- end
88
- end
89
-
90
- describe '#to_s' do
91
- it "should construct the command" do
92
- command = @growl.message('Hello World!').priority(1).image('mario.png').to_s
93
- expect(command).to eql "growlnotify --message 'Hello World!' --image mario.png --priority 1"
94
- end
95
-
96
- it "should construct the command with host password and auth" do
97
- command = @growl.message('Donuts').host('duff_bear').auth('SHA256').password('welcome_to_the_jungle').to_s
98
- expect(command).to eql "growlnotify --message 'Donuts' --host duff_bear --password welcome_to_the_jungle --auth SHA256"
99
- end
100
-
101
- it "should construct the command with title and message" do
102
- command = @growl.message('Last Kiss').title('Pearl Jam').to_s
103
- expect(command).to eql "growlnotify --title 'Pearl Jam' --message 'Last Kiss'"
104
- end
105
- end
106
-
107
- describe '#install_instructions' do
108
- it 'returns an more concise message' do
109
- expect(@growl.install_instructions).to eq 'The Growl is not installed. You can find more details here: http://growl.info/downloads'
110
- end
111
- end
112
- end
113
- end
@@ -1,42 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Notifiers
4
- describe Knotify do
5
- it_should_behave_like 'a notifier'
6
-
7
- before do
8
- @knotify = Knotify.new
9
- end
10
-
11
- describe '#message' do
12
- it "should set the message instance variable" do
13
- @knotify.message('Bulls on Parade')
14
- expect(@knotify.instance_variable_get(:@message)).to eql 'Bulls on Parade'
15
- end
16
-
17
- it "should be possible to set the message instance variable" do
18
- @knotify.message('Wake Up')
19
- expect(@knotify.instance_variable_get(:@message)).to eql 'Wake Up'
20
- end
21
- end
22
-
23
- describe '#title' do
24
- it "should set the title" do
25
- @knotify.title('Rage Against the Machine')
26
- expect(@knotify.instance_variable_get(:@title)).to eql 'Rage Against the Machine'
27
- end
28
-
29
- it "should be possible to set the title" do
30
- @knotify.title('AudioSlave')
31
- expect(@knotify.instance_variable_get(:@title)).to eql 'AudioSlave'
32
- end
33
- end
34
-
35
- describe '#to_s' do
36
- it "should return the entire command" do
37
- command = @knotify.title('Ruby').message('For the Win').to_s
38
- expect(command).to eql "dcop knotify default notify eventname 'Ruby' 'For the Win' '' '' 12 1"
39
- end
40
- end
41
- end
42
- end