urubatan-autotest-notification 0.2.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -1
- data/Manifest.txt +3 -1
- data/README.txt +13 -9
- data/autotest-notification.gemspec +10 -8
- data/bin/an-install +11 -2
- data/config/hoe.rb +6 -4
- data/lib/autotest_notification.rb +5 -4
- data/lib/autotest_notification/cygwin.rb +5 -1
- data/lib/autotest_notification/linux.rb +32 -17
- data/lib/autotest_notification/mac.rb +3 -2
- data/lib/autotest_notification/version.rb +2 -2
- data/test/autotest_notification/test_cygwin.rb +11 -0
- data/test/autotest_notification/test_linux.rb +64 -0
- data/test/autotest_notification/test_windows.rb +13 -0
- data/test/test_autotest_notification.rb +38 -11
- data/test/test_helper.rb +25 -2
- data/website/index.html +2 -2
- metadata +22 -7
data/History.txt
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
== 0.
|
1
|
+
== 0.3.0
|
2
|
+
* If a test failed, the computer will speak. Only for Mac.
|
3
|
+
|
4
|
+
* 0.2.2 2008-05-13
|
5
|
+
* Validating presence of KDialog; Fixing some identations.
|
6
|
+
* Adding some tests.
|
7
|
+
|
8
|
+
* 0.2.1 2008-05-13
|
9
|
+
* Starting to add tests.
|
10
|
+
|
11
|
+
* 0.2.0 2008-05-13
|
2
12
|
* Added support to Gnome at linux.rb (zenity).
|
3
13
|
* Changed filename windows.rb to cygwin.rb and added a new windows.rb file that uses Snarl to show the messages.
|
4
14
|
* README.txt updated with windows and linux dependencies.
|
data/Manifest.txt
CHANGED
@@ -9,7 +9,6 @@ config/requirements.rb
|
|
9
9
|
lib/autotest_notification.rb
|
10
10
|
lib/autotest_notification/version.rb
|
11
11
|
lib/autotest_notification/linux.rb
|
12
|
-
lib/autotest_notification/mac.rb
|
13
12
|
lib/autotest_notification/windows.rb
|
14
13
|
lib/autotest_notification/cygwin.rb
|
15
14
|
script/console
|
@@ -22,6 +21,9 @@ tasks/environment.rake
|
|
22
21
|
tasks/website.rake
|
23
22
|
test/test_autotest_notification.rb
|
24
23
|
test/test_helper.rb
|
24
|
+
test/autotest_notification/test_cygwin.rb
|
25
|
+
test/autotest_notification/test_linux.rb
|
26
|
+
test/autotest_notification/test_windows.rb
|
25
27
|
website/index.html
|
26
28
|
website/index.txt
|
27
29
|
website/javascripts/rounded_corners_lite.inc.js
|
data/README.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= THE AUTOTEST NOTIFICATION GEM
|
2
2
|
|
3
3
|
* http://github.com/carlosbrando/autotest-notification/
|
4
4
|
|
@@ -60,6 +60,9 @@ Independent of operating system you are using, you must install the ZenTest:
|
|
60
60
|
If you use KDE and do not have libnotify-bin installed, it will try to use kdialog wich is part of KDE.
|
61
61
|
It also works if you have zenity installed.
|
62
62
|
|
63
|
+
If you want to be notified with voice of the test results, instal espeak too, it is not needed.
|
64
|
+
And when running an-install, pass a "-s" switch, when you do not want voices notifications anymore, just run it again without the "-s" switch.
|
65
|
+
|
63
66
|
|
64
67
|
== INSTALL:
|
65
68
|
|
@@ -71,20 +74,21 @@ Run it to let the notifier in automatic mode:
|
|
71
74
|
|
72
75
|
In Windows without cygwin, it's necessary to install in the directory of the project:
|
73
76
|
|
74
|
-
$ an-install
|
77
|
+
$ an-install --path=C:\projects\my_project
|
75
78
|
|
76
79
|
To turn off the notifier:
|
77
80
|
|
78
81
|
$ an-uninstall
|
79
82
|
|
80
83
|
|
81
|
-
==
|
84
|
+
== CONTRIBUTORS:
|
82
85
|
|
83
|
-
* carlosbrando [http://www.nomedojogo.com
|
84
|
-
* simpsomboy [http://alexandredasilva.wordpress.com
|
85
|
-
* urubatan [http://www.urubatan.info
|
86
|
-
* chjunior [http://tas.milk-it.net
|
87
|
-
* daviscabral [http://blog.impactmedia.com.br
|
86
|
+
* carlosbrando [http://www.nomedojogo.com]
|
87
|
+
* simpsomboy [http://alexandredasilva.wordpress.com]
|
88
|
+
* urubatan [http://www.urubatan.info]
|
89
|
+
* chjunior [http://tas.milk-it.net]
|
90
|
+
* daviscabral [http://blog.impactmedia.com.br]
|
91
|
+
* tapajos [http://www.improveit.com.br/tapajos]
|
88
92
|
|
89
93
|
|
90
94
|
== LICENSE:
|
@@ -110,4 +114,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
110
114
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
111
115
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
112
116
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
113
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
117
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,17 +1,17 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{autotest-notification}
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "1.0.1"
|
4
4
|
|
5
5
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior", "Davis Zanetti Cabral"]
|
9
|
-
s.date = %q{2008-05-
|
10
|
-
s.description = %q{
|
8
|
+
s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior", "Davis Zanetti Cabral", "Marcos Tapaj\303\263s"]
|
9
|
+
s.date = %q{2008-05-16}
|
10
|
+
s.description = %q{This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.}
|
11
11
|
s.email = ["eduardobrando@gmail.com"]
|
12
12
|
s.executables = ["an-install", "an-uninstall"]
|
13
13
|
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "website/index.txt"]
|
14
|
-
s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "lib/autotest_notification/linux.rb", "lib/autotest_notification/mac.rb", "lib/autotest_notification/windows.rb", "lib/autotest_notification/cygwin.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "images/pass.png", "images/fail.png", "autotest-notification.gemspec"]
|
14
|
+
s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "lib/autotest_notification/linux.rb", "lib/autotest_notification/mac.rb", "lib/autotest_notification/windows.rb", "lib/autotest_notification/cygwin.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "test/autotest_notification/test_cygwin.rb", "test/autotest_notification/test_linux.rb", "test/autotest_notification/test_windows.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "images/pass.png", "images/fail.png", "autotest-notification.gemspec"]
|
15
15
|
s.has_rdoc = true
|
16
16
|
s.homepage = %q{http://github.com/carlosbrando/autotest-notification/}
|
17
17
|
s.post_install_message = %q{
|
@@ -26,8 +26,10 @@ To turn off:
|
|
26
26
|
}
|
27
27
|
s.rdoc_options = ["--main", "README.txt"]
|
28
28
|
s.require_paths = ["lib"]
|
29
|
-
s.rubyforge_project = %q{}
|
29
|
+
s.rubyforge_project = %q{autotest-notification}
|
30
30
|
s.rubygems_version = %q{1.1.1}
|
31
|
-
s.summary = %q{
|
32
|
-
s.test_files = ["test/test_autotest_notification.rb", "test/test_helper.rb"]
|
31
|
+
s.summary = %q{This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.}
|
32
|
+
s.test_files = ["test/autotest_notification/test_cygwin.rb", "test/autotest_notification/test_linux.rb", "test/autotest_notification/test_windows.rb", "test/test_autotest_notification.rb", "test/test_helper.rb"]
|
33
|
+
|
34
|
+
s.add_dependency(%q<ZenTest>, [">= 3.9.2"])
|
33
35
|
end
|
data/bin/an-install
CHANGED
@@ -15,7 +15,8 @@ require 'ftools'
|
|
15
15
|
# NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
|
16
16
|
|
17
17
|
OPTIONS = {
|
18
|
-
:path => '~'
|
18
|
+
:path => '~',
|
19
|
+
:speaking => false
|
19
20
|
}
|
20
21
|
MANDATORY_OPTIONS = %w( )
|
21
22
|
|
@@ -28,11 +29,18 @@ Usage: #{File.basename($0)} [options]
|
|
28
29
|
Options are:
|
29
30
|
BANNER
|
30
31
|
opts.separator ""
|
32
|
+
|
31
33
|
opts.on("-p", "--path=PATH", String,
|
32
34
|
"The root path for selecting files",
|
33
35
|
"Default: ~") { |OPTIONS[:path]| }
|
36
|
+
|
37
|
+
opts.on("-s", "--speaking",
|
38
|
+
"If a test failed, the computer will speak.",
|
39
|
+
"Only for Mac.") { |OPTIONS[:speaking]| OPTIONS[:speaking] = true }
|
40
|
+
|
34
41
|
opts.on("-h", "--help",
|
35
42
|
"Show this help message.") { puts opts; exit }
|
43
|
+
|
36
44
|
opts.parse!(ARGV)
|
37
45
|
|
38
46
|
if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
|
@@ -44,7 +52,8 @@ path = OPTIONS[:path]
|
|
44
52
|
|
45
53
|
f = File.new(File.expand_path(path) + "/.autotest", "w")
|
46
54
|
f.write "# ~.autotest\n"
|
47
|
-
f.write "require 'autotest_notification'"
|
55
|
+
f.write "require 'autotest_notification'\n"
|
56
|
+
f.write("SPEAKING = #{OPTIONS[:speaking]}\n")
|
48
57
|
f.close
|
49
58
|
puts "\nAs from now all tests will be notified automatically."
|
50
59
|
puts "" # a blank line
|
data/config/hoe.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'autotest_notification/version'
|
2
2
|
|
3
|
-
AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior, Davis Zanetti Cabral"
|
3
|
+
AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior, Davis Zanetti Cabral, Marcos Tapajós"
|
4
4
|
EMAIL = "eduardobrando@gmail.com"
|
5
|
-
DESCRIPTION = "
|
5
|
+
DESCRIPTION = "This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results."
|
6
6
|
GEM_NAME = 'autotest-notification' # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = '' # The unix name for your project
|
7
|
+
RUBYFORGE_PROJECT = nil # 'autotestnotific' # The unix name for your project
|
8
8
|
HOMEPATH = "http://github.com/carlosbrando/autotest-notification/"
|
9
9
|
DOWNLOAD_PATH = "http://github.com/carlosbrando/autotest-notification/tarball/master"
|
10
|
+
|
10
11
|
EXTRA_DEPENDENCIES = [
|
12
|
+
['ZenTest', '>= 3.9.2']
|
11
13
|
# ['activesupport', '>= 1.3.1']
|
12
14
|
] # An array of rubygem dependencies [name, version]
|
13
15
|
|
@@ -61,7 +63,7 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
61
63
|
|
62
64
|
# == Optional
|
63
65
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
-
|
66
|
+
p.extra_deps = EXTRA_DEPENDENCIES
|
65
67
|
|
66
68
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
69
|
end
|
@@ -43,9 +43,9 @@ module AutotestNotification
|
|
43
43
|
end
|
44
44
|
|
45
45
|
if failures > 0 || errors > 0
|
46
|
-
notify "FAIL", msg, FAIL_IMAGE, 2
|
46
|
+
notify "FAIL", msg, FAIL_IMAGE, failures, 2
|
47
47
|
else
|
48
|
-
notify "Pass", msg, SUCCESS_IMAGE
|
48
|
+
notify "Pass", msg, SUCCESS_IMAGE, failures
|
49
49
|
end
|
50
50
|
|
51
51
|
puts "\e[#{code}m#{'=' * 80}\e[0m\n\n"
|
@@ -53,12 +53,12 @@ module AutotestNotification
|
|
53
53
|
end
|
54
54
|
|
55
55
|
class << self
|
56
|
-
def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
|
56
|
+
def notify(title, msg, img = SUCCESS_IMAGE, failures = 0, pri = 0)
|
57
57
|
case RUBY_PLATFORM
|
58
58
|
when /linux/
|
59
59
|
Linux.notify(title, msg, img)
|
60
60
|
when /darwin/
|
61
|
-
Mac.notify(title, msg, img, pri)
|
61
|
+
Mac.notify(title, msg, img, failures, pri)
|
62
62
|
when /cygwin/
|
63
63
|
Cygwin.notify(title, msg, img)
|
64
64
|
when /mswin/
|
@@ -71,3 +71,4 @@ module AutotestNotification
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
74
|
+
|
@@ -2,11 +2,15 @@ module AutotestNotification
|
|
2
2
|
class Cygwin
|
3
3
|
class << self
|
4
4
|
def notify(title, msg, img)
|
5
|
-
img =
|
5
|
+
img = get_image_path(img)
|
6
6
|
img.strip!
|
7
7
|
|
8
8
|
system "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{EXPIRATION_IN_SECONDS}"
|
9
9
|
end
|
10
|
+
|
11
|
+
def get_image_path(img)
|
12
|
+
`cygpath -m #{img}`
|
13
|
+
end
|
10
14
|
end
|
11
15
|
end
|
12
16
|
end
|
@@ -4,33 +4,48 @@ module AutotestNotification
|
|
4
4
|
def notify(title, msg, img)
|
5
5
|
if has_notify?
|
6
6
|
notify_send(title, msg, img)
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
elsif has_zenity?
|
8
|
+
zenity(title, msg, img)
|
9
|
+
elsif has_kdialog?
|
10
10
|
kdialog(title, msg, img)
|
11
11
|
end
|
12
|
+
talk(msg)
|
13
|
+
true # true, cause we did everything we could
|
12
14
|
end
|
13
15
|
|
14
16
|
protected
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
def notify_send(title, msg, img)
|
18
|
+
system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
def kdialog(title, msg, img)
|
22
|
+
system "kdialog --title '#{title}' --passivepopup '#{msg}' #{EXPIRATION_IN_SECONDS}"
|
23
|
+
end
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
25
|
+
def zenity(title, msg, img)
|
26
|
+
system "zenity --info --text='#{msg}' --title='#{title}'"
|
27
|
+
end
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
def talk(msg)
|
30
|
+
begin
|
31
|
+
f = File.new('/usr/bin/espeak')
|
32
|
+
system("/usr/bin/espeak '#{msg}'") if SPEAKING && failures > 0
|
33
|
+
rescue
|
29
34
|
end
|
35
|
+
end
|
30
36
|
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
def has_zenity?
|
38
|
+
system "which zenity 2> /dev/null"
|
39
|
+
end
|
40
|
+
|
41
|
+
def has_notify?
|
42
|
+
system "which notify-send 2> /dev/null"
|
43
|
+
end
|
44
|
+
|
45
|
+
def has_kdialog?
|
46
|
+
system "which kdialog 2> /dev/null"
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
36
50
|
end
|
51
|
+
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module AutotestNotification
|
2
2
|
class Mac
|
3
3
|
class << self
|
4
|
-
def notify(title, msg, img, pri = 0)
|
5
|
-
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg
|
4
|
+
def notify(title, msg, img, failures = 0, pri = 0)
|
5
|
+
system "growlnotify -n autotest --image #{img} -p #{pri} -m '#{msg}' #{title}"
|
6
|
+
system("say #{failures} test#{'s' unless failures == 1} failed.") if SPEAKING && failures > 0
|
6
7
|
end
|
7
8
|
end
|
8
9
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
|
+
|
3
|
+
class TestCygwin < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_notify
|
6
|
+
AutotestNotification::Cygwin.expects(:get_image_path).with("image").returns(" image ")
|
7
|
+
AutotestNotification::Cygwin.expects(:system).with('sncmd /m \'title\' \'msg\' \'image\' /t 3')
|
8
|
+
AutotestNotification::Cygwin.notify("title", "msg", "image")
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
|
+
|
3
|
+
class TestLinux < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
turn_methods_public AutotestNotification::Linux
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_notify_when_use_notify
|
10
|
+
AutotestNotification::Linux.expects(:has_notify?).returns(true)
|
11
|
+
verify_notify(:notify_send)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_notify_when_use_zenity
|
15
|
+
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
16
|
+
AutotestNotification::Linux.expects(:has_zenity?).returns(true)
|
17
|
+
verify_notify(:zenity)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_notify_when_use_kdialog
|
21
|
+
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
22
|
+
AutotestNotification::Linux.expects(:has_zenity?).returns(false)
|
23
|
+
AutotestNotification::Linux.expects(:has_kdialog?).returns(true)
|
24
|
+
verify_notify(:kdialog)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_notify_send
|
28
|
+
AutotestNotification::Linux.expects(:system).with('notify-send -t 3000 -i image \'title\' \'msg\'')
|
29
|
+
AutotestNotification::Linux.notify_send("title", "msg", "image")
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_notify_kdialog
|
33
|
+
AutotestNotification::Linux.expects(:system).with('kdialog --title \'title\' --passivepopup \'msg\' 3')
|
34
|
+
AutotestNotification::Linux.kdialog("title", "msg", "image")
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_notify_zenity
|
38
|
+
AutotestNotification::Linux.expects(:system).with('zenity --info --text=\'msg\' --title=\'title\'')
|
39
|
+
AutotestNotification::Linux.zenity("title", "msg", "image")
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_has_zenity?
|
43
|
+
AutotestNotification::Linux.expects(:system).with('which zenity 2> /dev/null')
|
44
|
+
AutotestNotification::Linux.has_zenity?
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_has_notify?
|
48
|
+
AutotestNotification::Linux.expects(:system).with('which notify-send 2> /dev/null')
|
49
|
+
AutotestNotification::Linux.has_notify?
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_has_kdialog?
|
53
|
+
AutotestNotification::Linux.expects(:system).with('which kdialog 2> /dev/null')
|
54
|
+
AutotestNotification::Linux.has_kdialog?
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def verify_notify(method)
|
60
|
+
AutotestNotification::Linux.expects(method).returns("title", "msg", "image")
|
61
|
+
AutotestNotification::Linux.notify("title", "msg", "image")
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
|
+
|
3
|
+
class Snarl
|
4
|
+
end
|
5
|
+
|
6
|
+
class TestWindows < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def test_notify
|
9
|
+
Snarl.expects(:show_message).with("title", "msg", "image")
|
10
|
+
AutotestNotification::Windows.notify("title", "msg", "image")
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -1,11 +1,38 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
-
|
3
|
-
class TestAutotestNotification < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestAutotestNotification < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@title = "title"
|
7
|
+
@msg = "message"
|
8
|
+
@image = "image"
|
9
|
+
@pri = 1
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_notify_when_os_is_cygwin
|
13
|
+
AutotestNotification::Cygwin.expects(:notify).with(@title, @msg, @image)
|
14
|
+
verify_to("cygwin")
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_notify_when_os_is_windows
|
18
|
+
AutotestNotification::Windows.expects(:notify).with(@title, @msg, @image)
|
19
|
+
verify_to("mswin")
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_notify_when_os_is_linux
|
23
|
+
AutotestNotification::Linux.expects(:notify).with(@title, @msg, @image)
|
24
|
+
verify_to("linux")
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_notify_when_os_is_mac
|
28
|
+
Autotest::Growl.expects(:growl).with(@title, @msg, @pri, @image)
|
29
|
+
verify_to("darwin")
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def verify_to(so)
|
34
|
+
AutotestNotification.const_set("RUBY_PLATFORM", so)
|
35
|
+
AutotestNotification.notify(@title, @msg, @image, @pri)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,2 +1,25 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "test/unit"
|
2
|
+
require "rubygems"
|
3
|
+
require 'autotest'
|
4
|
+
require "mocha"
|
5
|
+
require File.dirname(__FILE__) + '/../lib/autotest_notification' unless defined?(AutotestNotification)
|
6
|
+
|
7
|
+
class Test::Unit::TestCase
|
8
|
+
def turn_methods_public(classe, method_name = nil)
|
9
|
+
if method_name
|
10
|
+
classe.class_eval do
|
11
|
+
public method_name
|
12
|
+
end
|
13
|
+
else
|
14
|
+
turn_all_methods_public classe
|
15
|
+
end
|
16
|
+
end
|
17
|
+
def turn_all_methods_public(classe)
|
18
|
+
classe.class_eval do
|
19
|
+
private_instance_methods.each { |instance_method| public instance_method }
|
20
|
+
private_methods.each { |method| public_class_method method }
|
21
|
+
protected_instance_methods.each { |instance_method| public instance_method }
|
22
|
+
protected_methods.each { |method| public_class_method method }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>autotest_notification</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/autotest_notification"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.3.0</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘autotest_notification’</h1>
|
39
39
|
|
@@ -130,7 +130,7 @@ rake install_gem</pre>
|
|
130
130
|
|
131
131
|
<p>Comments are welcome. Send an email to <a href="mailto:eduardobrando@gmail.com">Carlos Brando</a> via the <a href="http://groups.google.com/group/autotest_notification">forum</a></p>
|
132
132
|
<p class="coda">
|
133
|
-
<a href="FIXME email">FIXME full name</a>,
|
133
|
+
<a href="FIXME email">FIXME full name</a>, 16th May 2008<br>
|
134
134
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
135
135
|
</p>
|
136
136
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urubatan-autotest-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -9,15 +9,24 @@ authors:
|
|
9
9
|
- Alexandre da Silva
|
10
10
|
- "Carlos J\xC3\xBAnior"
|
11
11
|
- Davis Zanetti Cabral
|
12
|
+
- "Marcos Tapaj\xC3\xB3s"
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
16
|
|
16
|
-
date: 2008-05-
|
17
|
+
date: 2008-05-16 00:00:00 -07:00
|
17
18
|
default_executable:
|
18
|
-
dependencies:
|
19
|
-
|
20
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: ZenTest
|
22
|
+
version_requirement:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 3.9.2
|
28
|
+
version:
|
29
|
+
description: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
21
30
|
email:
|
22
31
|
- eduardobrando@gmail.com
|
23
32
|
executables:
|
@@ -57,6 +66,9 @@ files:
|
|
57
66
|
- tasks/website.rake
|
58
67
|
- test/test_autotest_notification.rb
|
59
68
|
- test/test_helper.rb
|
69
|
+
- test/autotest_notification/test_cygwin.rb
|
70
|
+
- test/autotest_notification/test_linux.rb
|
71
|
+
- test/autotest_notification/test_windows.rb
|
60
72
|
- website/index.html
|
61
73
|
- website/index.txt
|
62
74
|
- website/javascripts/rounded_corners_lite.inc.js
|
@@ -98,11 +110,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
110
|
version:
|
99
111
|
requirements: []
|
100
112
|
|
101
|
-
rubyforge_project:
|
113
|
+
rubyforge_project: autotest-notification
|
102
114
|
rubygems_version: 1.0.1
|
103
115
|
signing_key:
|
104
116
|
specification_version: 2
|
105
|
-
summary:
|
117
|
+
summary: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
106
118
|
test_files:
|
119
|
+
- test/autotest_notification/test_cygwin.rb
|
120
|
+
- test/autotest_notification/test_linux.rb
|
121
|
+
- test/autotest_notification/test_windows.rb
|
107
122
|
- test/test_autotest_notification.rb
|
108
123
|
- test/test_helper.rb
|