test_notifier 0.3.4 → 0.3.5.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/test_notifier/notifier/growl.rb +1 -1
- data/lib/test_notifier/notifier/kdialog.rb +1 -1
- data/lib/test_notifier/notifier/knotify.rb +1 -1
- data/lib/test_notifier/notifier/notify_send.rb +1 -1
- data/lib/test_notifier/notifier/osd_cat.rb +1 -1
- data/lib/test_notifier/notifier/placebo.rb +14 -0
- data/lib/test_notifier/notifier.rb +2 -1
- data/lib/test_notifier/runner/rspec.rb +1 -1
- data/lib/test_notifier/version.rb +1 -1
- data/lib/test_notifier.rb +5 -5
- data/test/notifier_test.rb +1 -1
- data/test/test_notifier_test.rb +5 -4
- metadata +12 -7
data/README.rdoc
CHANGED
@@ -49,7 +49,7 @@ You can define your notifier.
|
|
49
49
|
|
50
50
|
TestNotifier.default_notifier = :growl
|
51
51
|
|
52
|
-
The available notifiers are <tt>:growl</tt>, <tt>:kdialog</tt>, <tt>:knotify</tt>, <tt>:notify_send</tt>, <tt>:osd_cat</tt
|
52
|
+
The available notifiers are <tt>:growl</tt>, <tt>:kdialog</tt>, <tt>:knotify</tt>, <tt>:notify_send</tt>, <tt>:osd_cat</tt>, and <tt>:snarl</tt></tt>.
|
53
53
|
|
54
54
|
== Maintainer
|
55
55
|
|
@@ -7,7 +7,7 @@ module TestNotifier
|
|
7
7
|
FILE = File.expand_path("~/.test_notifier-growl")
|
8
8
|
|
9
9
|
def supported?
|
10
|
-
RUBY_PLATFORM =~ /darwin/ && `ps -Al | grep GrowlHelper` && `which growlnotify` &&
|
10
|
+
RUBY_PLATFORM =~ /darwin/ && `ps -Al | grep GrowlHelper` && `which growlnotify` && $?.exitstatus == 0
|
11
11
|
end
|
12
12
|
|
13
13
|
def notify(options)
|
@@ -6,6 +6,7 @@ module TestNotifier
|
|
6
6
|
autoload :Knotify, "test_notifier/notifier/knotify"
|
7
7
|
autoload :Kdialog, "test_notifier/notifier/kdialog"
|
8
8
|
autoload :NotifySend, "test_notifier/notifier/notify_send"
|
9
|
+
autoload :Placebo, "test_notifier/notifier/placebo"
|
9
10
|
|
10
11
|
extend self
|
11
12
|
|
@@ -21,7 +22,7 @@ module TestNotifier
|
|
21
22
|
|
22
23
|
def from_name(name)
|
23
24
|
notifier = const_get(classify(name.to_s))
|
24
|
-
rescue
|
25
|
+
rescue Exception
|
25
26
|
nil
|
26
27
|
end
|
27
28
|
|
data/lib/test_notifier.rb
CHANGED
@@ -6,7 +6,7 @@ module TestNotifier
|
|
6
6
|
|
7
7
|
extend self
|
8
8
|
|
9
|
-
|
9
|
+
NO_NOTIFIERS_MESSAGE = "[TEST NOTIFIER] You have no supported notifiers installed. Please read documentation."
|
10
10
|
|
11
11
|
IMAGES = {
|
12
12
|
:fail => File.dirname(__FILE__) + "/../resources/fail.png",
|
@@ -31,11 +31,11 @@ module TestNotifier
|
|
31
31
|
|
32
32
|
def notifier
|
33
33
|
self.__notifier__ ||= begin
|
34
|
-
notifier =
|
35
|
-
notifier
|
36
|
-
|
34
|
+
notifier = TestNotifier::Notifier.supported_notifier_from_name(default_notifier)
|
35
|
+
notifier ||= TestNotifier::Notifier.supported_notifiers.first
|
36
|
+
|
37
|
+
STDERR << NO_NOTIFIERS_MESSAGE if notifier == TestNotifier::Notifier::Placebo
|
37
38
|
|
38
|
-
raise UnsupportedNotifierError, "You have no supported notifiers installed. Please read documentation." unless notifier
|
39
39
|
notifier
|
40
40
|
end
|
41
41
|
end
|
data/test/notifier_test.rb
CHANGED
@@ -13,7 +13,7 @@ class TestNotifier::NotifierTest < Test::Unit::TestCase
|
|
13
13
|
end
|
14
14
|
|
15
15
|
test "retrieve list of all notifiers" do
|
16
|
-
assert_equal
|
16
|
+
assert_equal 7, TestNotifier::Notifier.notifiers.size
|
17
17
|
end
|
18
18
|
|
19
19
|
test "return notifier by its name" do
|
data/test/test_notifier_test.rb
CHANGED
@@ -20,10 +20,11 @@ class TestNotifierTest < Test::Unit::TestCase
|
|
20
20
|
assert_equal TestNotifier::Notifier::Snarl, TestNotifier.notifier
|
21
21
|
end
|
22
22
|
|
23
|
-
test "
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
test "output error message to $stderr when there's no supported notifier" do
|
24
|
+
STDERR.expects(:<<).with(TestNotifier::NO_NOTIFIERS_MESSAGE).once
|
25
|
+
TestNotifier::Notifier::Placebo.expects(:supported?).returns(true)
|
26
|
+
TestNotifier::Notifier::Placebo.expects(:notify).once
|
27
|
+
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
27
28
|
end
|
28
29
|
|
29
30
|
test "send notification to supported notifier" do
|
metadata
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: true
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
|
8
|
+
- 5
|
9
|
+
- rc
|
10
|
+
- 1
|
11
|
+
version: 0.3.5.rc.1
|
10
12
|
platform: ruby
|
11
13
|
authors:
|
12
14
|
- Nando Vieira
|
@@ -14,7 +16,7 @@ autorequire:
|
|
14
16
|
bindir: bin
|
15
17
|
cert_chain: []
|
16
18
|
|
17
|
-
date: 2010-
|
19
|
+
date: 2010-10-28 00:00:00 -02:00
|
18
20
|
default_executable:
|
19
21
|
dependencies: []
|
20
22
|
|
@@ -36,6 +38,7 @@ files:
|
|
36
38
|
- lib/test_notifier/notifier/knotify.rb
|
37
39
|
- lib/test_notifier/notifier/notify_send.rb
|
38
40
|
- lib/test_notifier/notifier/osd_cat.rb
|
41
|
+
- lib/test_notifier/notifier/placebo.rb
|
39
42
|
- lib/test_notifier/notifier/snarl.rb
|
40
43
|
- lib/test_notifier/rspec.rb
|
41
44
|
- lib/test_notifier/runner.rb
|
@@ -74,11 +77,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
78
|
none: false
|
76
79
|
requirements:
|
77
|
-
- - "
|
80
|
+
- - ">"
|
78
81
|
- !ruby/object:Gem::Version
|
79
82
|
segments:
|
80
|
-
-
|
81
|
-
|
83
|
+
- 1
|
84
|
+
- 3
|
85
|
+
- 1
|
86
|
+
version: 1.3.1
|
82
87
|
requirements:
|
83
88
|
- You'll need Growl (Mac OS X), Libnotify, OSD or KDE (Linux) or Snarl (Windows)
|
84
89
|
rubyforge_project:
|