test_notifier 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/README.rdoc +5 -1
- data/lib/test_notifier/version.rb +2 -2
- data/lib/test_notifier.rb +7 -3
- data/test/test_notifier_test.rb +8 -0
- metadata +13 -16
- data/lib/test_notifier/autotest.rb +0 -7
- data/lib/test_notifier/rspec.rb +0 -11
- data/lib/test_notifier/test_unit.rb +0 -6
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test_notifier (0.
|
4
|
+
test_notifier (1.0.0)
|
5
5
|
notifier
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://gems.simplesideias.com.br/
|
9
9
|
specs:
|
10
10
|
mocha (0.9.12)
|
11
|
-
notifier (0.1.
|
11
|
+
notifier (0.1.4)
|
12
12
|
rake (0.9.2)
|
13
|
-
test-unit (2.
|
13
|
+
test-unit (2.2.0)
|
14
14
|
|
15
15
|
PLATFORMS
|
16
16
|
ruby
|
data/README.rdoc
CHANGED
@@ -23,7 +23,7 @@ If you're using Test::Unit you should add <tt>require "test_notifier/runner/test
|
|
23
23
|
|
24
24
|
If you're using RSpec you should add <tt>require "test_notifier/runner/spec"</tt> to your <tt>spec_helper.rb</tt> file. If you're using RSpec 2, you need to add <tt>require "test_notifier/runner/rspec"</tt> instead.
|
25
25
|
|
26
|
-
If you're using Autotest you should add <tt>require test_notifier/runner/autotest"</tt> to
|
26
|
+
If you're using Autotest you should add <tt>require "test_notifier/runner/autotest"</tt> to
|
27
27
|
the file <tt>~/.autotest</tt>
|
28
28
|
|
29
29
|
If you're using MiniTest you should add <tt>require "test_notifier/runner/minitest"</tt> to your <tt>test_helper.rb</tt> file.
|
@@ -34,6 +34,10 @@ You can define your notifier.
|
|
34
34
|
|
35
35
|
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>.
|
36
36
|
|
37
|
+
If you'd like to make Test Notifier optional for your project:
|
38
|
+
|
39
|
+
TestNotifier.silence_no_notifier_warning = true
|
40
|
+
|
37
41
|
== Maintainer
|
38
42
|
|
39
43
|
* Nando Vieira - http://simplesideias.com.br
|
data/lib/test_notifier.rb
CHANGED
@@ -2,12 +2,12 @@ require "notifier"
|
|
2
2
|
|
3
3
|
module TestNotifier
|
4
4
|
class << self
|
5
|
-
attr_accessor :default_notifier
|
5
|
+
attr_accessor :default_notifier, :silence_no_notifier_warning
|
6
6
|
end
|
7
7
|
|
8
8
|
extend self
|
9
9
|
|
10
|
-
NO_NOTIFIERS_MESSAGE = "[TEST NOTIFIER] You have no supported notifiers installed. Please read documentation
|
10
|
+
NO_NOTIFIERS_MESSAGE = "[TEST NOTIFIER] You have no supported notifiers installed. Please read documentation.\n"
|
11
11
|
|
12
12
|
IMAGES = {
|
13
13
|
:fail => File.dirname(__FILE__) + "/../resources/fail.png",
|
@@ -40,7 +40,11 @@ module TestNotifier
|
|
40
40
|
def notifier
|
41
41
|
Notifier.default_notifier = default_notifier
|
42
42
|
notifier = Notifier.notifier
|
43
|
-
|
43
|
+
|
44
|
+
if notifier == Notifier::Placebo && !silence_no_notifier_warning
|
45
|
+
STDERR << NO_NOTIFIERS_MESSAGE
|
46
|
+
end
|
47
|
+
|
44
48
|
notifier
|
45
49
|
end
|
46
50
|
|
data/test/test_notifier_test.rb
CHANGED
@@ -20,6 +20,14 @@ class TestNotifierTest < Test::Unit::TestCase
|
|
20
20
|
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
21
21
|
end
|
22
22
|
|
23
|
+
test "output error message won't display when silence_no_notifier_warning is true" do
|
24
|
+
TestNotifier.silence_no_notifier_warning = true
|
25
|
+
STDERR.expects(:<<).with(TestNotifier::NO_NOTIFIERS_MESSAGE).never
|
26
|
+
Notifier::Placebo.expects(:supported?).returns(true)
|
27
|
+
Notifier::Placebo.expects(:notify).once
|
28
|
+
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
29
|
+
end
|
30
|
+
|
23
31
|
test "send notification to supported notifier" do
|
24
32
|
Notifier::Snarl.expects(:supported?).returns(true)
|
25
33
|
Notifier::Snarl.expects(:notify).with({
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: notifier
|
16
|
-
requirement: &
|
16
|
+
requirement: &70363782479620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70363782479620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: test-unit
|
27
|
-
requirement: &
|
27
|
+
requirement: &70363782478180 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70363782478180
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: mocha
|
38
|
-
requirement: &
|
38
|
+
requirement: &70363782476880 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70363782476880
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &70363782475800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70363782475800
|
58
58
|
description: ! 'Display system notifications (dbus, growl and snarl) after
|
59
59
|
|
60
60
|
running tests. It works on Mac OS X, Linux and Windows. Powerful when used
|
@@ -74,8 +74,6 @@ files:
|
|
74
74
|
- README.rdoc
|
75
75
|
- Rakefile
|
76
76
|
- lib/test_notifier.rb
|
77
|
-
- lib/test_notifier/autotest.rb
|
78
|
-
- lib/test_notifier/rspec.rb
|
79
77
|
- lib/test_notifier/runner.rb
|
80
78
|
- lib/test_notifier/runner/autotest.rb
|
81
79
|
- lib/test_notifier/runner/minitest.rb
|
@@ -83,7 +81,6 @@ files:
|
|
83
81
|
- lib/test_notifier/runner/spec.rb
|
84
82
|
- lib/test_notifier/runner/test_unit.rb
|
85
83
|
- lib/test_notifier/stats.rb
|
86
|
-
- lib/test_notifier/test_unit.rb
|
87
84
|
- lib/test_notifier/version.rb
|
88
85
|
- resources/error.png
|
89
86
|
- resources/fail.png
|
@@ -107,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
104
|
version: '0'
|
108
105
|
segments:
|
109
106
|
- 0
|
110
|
-
hash:
|
107
|
+
hash: 3482717960648985937
|
111
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
109
|
none: false
|
113
110
|
requirements:
|
@@ -116,10 +113,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
113
|
version: '0'
|
117
114
|
segments:
|
118
115
|
- 0
|
119
|
-
hash:
|
116
|
+
hash: 3482717960648985937
|
120
117
|
requirements: []
|
121
118
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.8.
|
119
|
+
rubygems_version: 1.8.10
|
123
120
|
signing_key:
|
124
121
|
specification_version: 3
|
125
122
|
summary: Display system notifications (dbus, growl and snarl) after running tests.
|
@@ -1,7 +0,0 @@
|
|
1
|
-
require "test_notifier/runner/autotest"
|
2
|
-
|
3
|
-
warn <<-TXT
|
4
|
-
[TestNotifier] Using `require "test_notifier/autotest"` is deprecated and
|
5
|
-
will be removed in the future. Please update your `~/.autotest` file to use
|
6
|
-
`require "test_notifier/runner/autotest"` instead.
|
7
|
-
TXT
|
data/lib/test_notifier/rspec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
if defined?(RSpec)
|
2
|
-
require "test_notifier/runner/rspec"
|
3
|
-
else
|
4
|
-
require "test_notifier/runner/spec"
|
5
|
-
end
|
6
|
-
|
7
|
-
warn <<-TXT
|
8
|
-
[TestNotifier] Using `require "test_notifier/rspec"` is deprecated and
|
9
|
-
will be removed in the future. Please use `require "test_notifier/runner/spec"`
|
10
|
-
or `require "test_notifier/runner/rspec"` for RSpec 2 instead.
|
11
|
-
TXT
|