chjunior-autotest-notification 0.0.8 → 0.2.1
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.
- data/History.txt +13 -1
- data/Manifest.txt +8 -0
- data/README.txt +73 -15
- data/autotest-notification.gemspec +7 -7
- data/config/hoe.rb +2 -2
- data/lib/autotest_notification.rb +12 -29
- data/lib/autotest_notification/cygwin.rb +16 -0
- data/lib/autotest_notification/linux.rb +40 -0
- data/lib/autotest_notification/mac.rb +9 -0
- data/lib/autotest_notification/version.rb +2 -2
- data/lib/autotest_notification/windows.rb +11 -0
- data/test/autotest_notification/test_cygwin.rb +11 -0
- data/test/autotest_notification/test_linux.rb +58 -0
- data/test/autotest_notification/test_mac.rb +10 -0
- data/test/autotest_notification/test_windows.rb +13 -0
- data/test/test_autotest_notification.rb +38 -11
- data/test/test_helper.rb +28 -2
- data/website/index.html +1 -1
- metadata +18 -4
data/History.txt
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
== 0.
|
1
|
+
== 0.2.1 2008-05-13
|
2
|
+
* Starting to add tests.
|
3
|
+
|
4
|
+
* 0.2.0 2008-05-13
|
5
|
+
* Added support to Gnome at linux.rb (zenity).
|
6
|
+
* Changed filename windows.rb to cygwin.rb and added a new windows.rb file that uses Snarl to show the messages.
|
7
|
+
* README.txt updated with windows and linux dependencies.
|
8
|
+
|
9
|
+
* 0.1.0 2008-05-13
|
10
|
+
* Separated each operating system into a different file to facilitate maintenance. It's necessary to conduct more tests in each scene.
|
11
|
+
|
12
|
+
* 0.0.9:
|
13
|
+
* Adding KDE (kdialog) support.
|
2
14
|
|
3
15
|
* 0.0.7:
|
4
16
|
* Added support to Windows.
|
data/Manifest.txt
CHANGED
@@ -8,6 +8,10 @@ config/hoe.rb
|
|
8
8
|
config/requirements.rb
|
9
9
|
lib/autotest_notification.rb
|
10
10
|
lib/autotest_notification/version.rb
|
11
|
+
lib/autotest_notification/linux.rb
|
12
|
+
lib/autotest_notification/mac.rb
|
13
|
+
lib/autotest_notification/windows.rb
|
14
|
+
lib/autotest_notification/cygwin.rb
|
11
15
|
script/console
|
12
16
|
script/destroy
|
13
17
|
script/generate
|
@@ -18,6 +22,10 @@ tasks/environment.rake
|
|
18
22
|
tasks/website.rake
|
19
23
|
test/test_autotest_notification.rb
|
20
24
|
test/test_helper.rb
|
25
|
+
test/autotest_notification/test_cygwin.rb
|
26
|
+
test/autotest_notification/test_linux.rb
|
27
|
+
test/autotest_notification/test_mac.rb
|
28
|
+
test/autotest_notification/test_windows.rb
|
21
29
|
website/index.html
|
22
30
|
website/index.txt
|
23
31
|
website/javascripts/rounded_corners_lite.inc.js
|
data/README.txt
CHANGED
@@ -1,39 +1,97 @@
|
|
1
1
|
= The Autotest Notification Gem
|
2
2
|
|
3
|
-
* http://
|
3
|
+
* http://github.com/carlosbrando/autotest-notification/
|
4
4
|
|
5
|
-
== DESCRIPTION:
|
6
5
|
|
7
|
-
|
6
|
+
== DESCRIPTION:
|
8
7
|
|
9
|
-
|
8
|
+
This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
10
9
|
|
11
|
-
* Running on Mac (Growl), Linux (LibNotify) and Windows (Snarl).
|
12
10
|
|
13
11
|
== REQUIREMENTS:
|
14
12
|
|
15
|
-
|
13
|
+
Independent of operating system you are using, you must install the ZenTest:
|
14
|
+
|
15
|
+
$ gem install ZenTest
|
16
|
+
|
17
|
+
|
18
|
+
* If you're using a Mac:
|
19
|
+
You need to have Growl and growlnotify installed on your machine.
|
20
|
+
|
21
|
+
Download the Growl [http://growl.info/index.php] and install it like any other application on your Mac
|
22
|
+
|
23
|
+
Then you must install the growlnotify.
|
24
|
+
|
25
|
+
In your shell, cd to the directory on the Growl disk image containing growlnotify, and type ./install.sh.
|
26
|
+
That script will install growlnotify to /usr/local/bin and the manpage to /usr/local/man.
|
27
|
+
|
28
|
+
|
29
|
+
* If you're using Windows (with cygwin):
|
30
|
+
You need to have Snarl and sncmd installed on your machine.
|
31
|
+
|
32
|
+
Download Snarl [http://www.fullphat.net/] and install it like any other application on your machine.
|
33
|
+
|
34
|
+
Then download sncmd [http://www.k23productions.com/download.php?view.105] open the zip file and place
|
35
|
+
the executable from the zip in any directory in windows PATH (for example c:\windows).
|
36
|
+
|
37
|
+
|
38
|
+
* If you're using Windows (without cygwin):
|
39
|
+
You need to have Snarl, diffutils and ruby-snarl installed on your machine.
|
40
|
+
|
41
|
+
Download Snarl [http://www.fullphat.net/] and install it like any other application on your machine.
|
42
|
+
|
43
|
+
Download DiffUtils for Windows [http://gnuwin32.sourceforge.net/packages/diffutils.htm] and follow the installation instructions on the site.
|
44
|
+
|
45
|
+
Run in the command prompt:
|
46
|
+
|
47
|
+
$ gem install ruby-snarl
|
48
|
+
|
49
|
+
After all that. You must update the environment variable PATH with the path to the bin of diffutils.
|
50
|
+
It's the price that was paid for using Windows (try cygwin).
|
51
|
+
|
52
|
+
|
53
|
+
* If you're using Linux:
|
54
|
+
You need to have libnotify binaries installed.
|
55
|
+
|
56
|
+
For ubuntu this means: sudo apt-get install libnotify-bin
|
57
|
+
|
58
|
+
Other distributions may package it with other names, do a search for libnotify using your distribution package manager.
|
59
|
+
|
60
|
+
If you use KDE and do not have libnotify-bin installed, it will try to use kdialog wich is part of KDE.
|
61
|
+
It also works if you have zenity installed.
|
62
|
+
|
16
63
|
|
17
64
|
== INSTALL:
|
18
65
|
|
19
|
-
|
20
|
-
|
21
|
-
Run it:
|
66
|
+
$ sudo gem install carlosbrando-autotest-notification --source=http://gems.github.com
|
67
|
+
|
68
|
+
Run it to let the notifier in automatic mode:
|
69
|
+
|
70
|
+
$ an-install
|
71
|
+
|
72
|
+
In Windows without cygwin, it's necessary to install in the directory of the project:
|
73
|
+
|
74
|
+
$ an-install -p C:\projects\my_project
|
75
|
+
|
76
|
+
To turn off the notifier:
|
77
|
+
|
78
|
+
$ an-uninstall
|
22
79
|
|
23
|
-
$ an-install
|
24
80
|
|
25
81
|
== Contributors
|
26
82
|
|
27
|
-
* carlosbrando
|
28
|
-
* simpsomboy
|
29
|
-
* urubatan
|
30
|
-
* chjunior
|
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]
|
88
|
+
* tapajos [http://www.improveit.com.br/tapajos]
|
31
89
|
|
32
90
|
== LICENSE:
|
33
91
|
|
34
92
|
(The MIT License)
|
35
93
|
|
36
|
-
Copyright (c) 2008
|
94
|
+
Copyright (c) 2008
|
37
95
|
|
38
96
|
Permission is hereby granted, free of charge, to any person obtaining
|
39
97
|
a copy of this software and associated documentation files (the
|
@@ -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 = "0.2.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
|
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-13}
|
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", "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_mac.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{
|
@@ -28,6 +28,6 @@ To turn off:
|
|
28
28
|
s.require_paths = ["lib"]
|
29
29
|
s.rubyforge_project = %q{}
|
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_mac.rb", "test/autotest_notification/test_windows.rb", "test/test_autotest_notification.rb", "test/test_helper.rb"]
|
33
33
|
end
|
data/config/hoe.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'autotest_notification/version'
|
2
2
|
|
3
|
-
AUTHOR = "Carlos Brando"
|
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
7
|
RUBYFORGE_PROJECT = '' # The unix name for your project
|
8
8
|
HOMEPATH = "http://github.com/carlosbrando/autotest-notification/"
|
@@ -1,5 +1,8 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__))
|
2
|
-
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'autotest_notification/linux'
|
3
|
+
require 'autotest_notification/mac'
|
4
|
+
require 'autotest_notification/windows'
|
5
|
+
require 'autotest_notification/cygwin'
|
3
6
|
|
4
7
|
module AutotestNotification
|
5
8
|
FAIL = -1
|
@@ -13,7 +16,9 @@ module AutotestNotification
|
|
13
16
|
FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png"
|
14
17
|
|
15
18
|
Autotest.add_hook :ran_command do |at|
|
16
|
-
|
19
|
+
|
20
|
+
result = at.results.is_a?(Array) ? at.results.last : at.results.split("\n").last
|
21
|
+
|
17
22
|
if result
|
18
23
|
|
19
24
|
# Test::Unit
|
@@ -51,40 +56,18 @@ module AutotestNotification
|
|
51
56
|
def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
|
52
57
|
case RUBY_PLATFORM
|
53
58
|
when /linux/
|
54
|
-
|
59
|
+
Linux.notify(title, msg, img)
|
55
60
|
when /darwin/
|
56
|
-
|
61
|
+
Mac.notify(title, msg, img, pri)
|
57
62
|
when /cygwin/
|
58
|
-
|
59
|
-
snarl(title, msg, img.strip)
|
63
|
+
Cygwin.notify(title, msg, img)
|
60
64
|
when /mswin/
|
61
|
-
|
65
|
+
Windows.notify(title, msg, img)
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
65
69
|
def pluralize(text, number)
|
66
70
|
"#{number} #{text}#{'s' if number != 1}"
|
67
71
|
end
|
68
|
-
|
69
|
-
def growl(title, msg, img, pri = 0)
|
70
|
-
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title}"
|
71
|
-
end
|
72
|
-
|
73
|
-
def notify_send(title, msg, img)
|
74
|
-
system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
|
75
|
-
end
|
76
|
-
|
77
|
-
def kdialog(title, msg, img)
|
78
|
-
system "kdialog --title '#{title}' --passivepopup '#{msg}' #{EXPIRATION_IN_SECONDS}"
|
79
|
-
end
|
80
|
-
|
81
|
-
def has_notify?
|
82
|
-
system "which notify-send 2> /dev/null"
|
83
|
-
end
|
84
|
-
|
85
|
-
def snarl(title, msg, img)
|
86
|
-
message = "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{EXPIRATION_IN_SECONDS}"
|
87
|
-
system message
|
88
|
-
end
|
89
72
|
end
|
90
73
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module AutotestNotification
|
2
|
+
class Cygwin
|
3
|
+
class << self
|
4
|
+
def notify(title, msg, img)
|
5
|
+
img = get_image_path(img)
|
6
|
+
img.strip!
|
7
|
+
|
8
|
+
system "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{EXPIRATION_IN_SECONDS}"
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_image_path(img)
|
12
|
+
`cygpath -m #{img}`
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module AutotestNotification
|
2
|
+
class Linux
|
3
|
+
class << self
|
4
|
+
def notify(title, msg, img)
|
5
|
+
if has_notify?
|
6
|
+
notify_send(title, msg, img)
|
7
|
+
elsif has_zenity?
|
8
|
+
zenity(title, msg, img)
|
9
|
+
elsif has_kdialog?
|
10
|
+
kdialog(title, msg, img)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
def notify_send(title, msg, img)
|
16
|
+
system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
|
17
|
+
end
|
18
|
+
|
19
|
+
def kdialog(title, msg, img)
|
20
|
+
system "kdialog --title '#{title}' --passivepopup '#{msg}' #{EXPIRATION_IN_SECONDS}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def zenity(title, msg, img)
|
24
|
+
system "zenity --info --text='#{msg}' --title='#{title}'"
|
25
|
+
end
|
26
|
+
|
27
|
+
def has_zenity?
|
28
|
+
system "which zenity 2> /dev/null"
|
29
|
+
end
|
30
|
+
|
31
|
+
def has_notify?
|
32
|
+
system "which notify-send 2> /dev/null"
|
33
|
+
end
|
34
|
+
|
35
|
+
def has_kdialog?
|
36
|
+
system "which kdialog 2> /dev/null"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
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,58 @@
|
|
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
|
+
verify_notify(:kdialog)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_notify_send
|
27
|
+
AutotestNotification::Linux.expects(:system).with('notify-send -t 3000 -i image \'title\' \'msg\'')
|
28
|
+
AutotestNotification::Linux.notify_send("title", "msg", "image")
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_notify_kdialog
|
32
|
+
AutotestNotification::Linux.expects(:system).with('kdialog --title \'title\' --passivepopup \'msg\' 3')
|
33
|
+
AutotestNotification::Linux.kdialog("title", "msg", "image")
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_notify_zenity
|
37
|
+
AutotestNotification::Linux.expects(:system).with('zenity --info --text=\'msg\' --title=\'title\'')
|
38
|
+
AutotestNotification::Linux.zenity("title", "msg", "image")
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_has_zenity?
|
42
|
+
AutotestNotification::Linux.expects(:system).with('which zenity 2> /dev/null')
|
43
|
+
AutotestNotification::Linux.has_zenity?
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_has_notify?
|
47
|
+
AutotestNotification::Linux.expects(:system).with('which notify-send 2> /dev/null')
|
48
|
+
AutotestNotification::Linux.has_notify?
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def verify_notify(method)
|
54
|
+
AutotestNotification::Linux.expects(method).returns("title", "msg", "image")
|
55
|
+
AutotestNotification::Linux.notify("title", "msg", "image")
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
|
+
|
3
|
+
class TestMac < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_notify
|
6
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' title")
|
7
|
+
AutotestNotification::Mac.notify("title", "msg", "image")
|
8
|
+
end
|
9
|
+
|
10
|
+
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
|
+
AutotestNotification::Mac.expects(:notify).with(@title, @msg, @image, @pri)
|
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,28 @@
|
|
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
|
26
|
+
|
27
|
+
|
28
|
+
|
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.2.1</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘autotest_notification’</h1>
|
39
39
|
|
metadata
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chjunior-autotest-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
8
8
|
- Rodrigo Urubatan
|
9
9
|
- Alexandre da Silva
|
10
10
|
- "Carlos J\xC3\xBAnior"
|
11
|
+
- Davis Zanetti Cabral
|
12
|
+
- "Marcos Tapaj\xC3\xB3s"
|
11
13
|
autorequire:
|
12
14
|
bindir: bin
|
13
15
|
cert_chain: []
|
14
16
|
|
15
|
-
date: 2008-05-
|
17
|
+
date: 2008-05-13 00:00:00 -07:00
|
16
18
|
default_executable:
|
17
19
|
dependencies: []
|
18
20
|
|
19
|
-
description:
|
21
|
+
description: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
20
22
|
email:
|
21
23
|
- eduardobrando@gmail.com
|
22
24
|
executables:
|
@@ -42,6 +44,10 @@ files:
|
|
42
44
|
- config/requirements.rb
|
43
45
|
- lib/autotest_notification.rb
|
44
46
|
- lib/autotest_notification/version.rb
|
47
|
+
- lib/autotest_notification/linux.rb
|
48
|
+
- lib/autotest_notification/mac.rb
|
49
|
+
- lib/autotest_notification/windows.rb
|
50
|
+
- lib/autotest_notification/cygwin.rb
|
45
51
|
- script/console
|
46
52
|
- script/destroy
|
47
53
|
- script/generate
|
@@ -52,6 +58,10 @@ files:
|
|
52
58
|
- tasks/website.rake
|
53
59
|
- test/test_autotest_notification.rb
|
54
60
|
- test/test_helper.rb
|
61
|
+
- test/autotest_notification/test_cygwin.rb
|
62
|
+
- test/autotest_notification/test_linux.rb
|
63
|
+
- test/autotest_notification/test_mac.rb
|
64
|
+
- test/autotest_notification/test_windows.rb
|
55
65
|
- website/index.html
|
56
66
|
- website/index.txt
|
57
67
|
- website/javascripts/rounded_corners_lite.inc.js
|
@@ -97,7 +107,11 @@ rubyforge_project: ""
|
|
97
107
|
rubygems_version: 1.0.1
|
98
108
|
signing_key:
|
99
109
|
specification_version: 2
|
100
|
-
summary:
|
110
|
+
summary: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
101
111
|
test_files:
|
112
|
+
- test/autotest_notification/test_cygwin.rb
|
113
|
+
- test/autotest_notification/test_linux.rb
|
114
|
+
- test/autotest_notification/test_mac.rb
|
115
|
+
- test/autotest_notification/test_windows.rb
|
102
116
|
- test/test_autotest_notification.rb
|
103
117
|
- test/test_helper.rb
|