test_notifier 0.0.7 → 0.0.8
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 +4 -0
- data/lib/test_notifier/autotest.rb +5 -2
- data/lib/test_notifier/rspec.rb +14 -11
- data/lib/test_notifier/test_unit.rb +9 -13
- data/lib/test_notifier/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
require 'test_notifier'
|
2
2
|
|
3
3
|
Autotest.add_hook :ran_command do |at|
|
4
|
-
|
4
|
+
begin
|
5
|
+
content = at.results.to_s
|
5
6
|
|
6
|
-
|
7
|
+
TestNotifier.rspec?(content) ? TestNotifier.notification_for_rspec(content) : TestNotifier.notification_for_test_unit(content)
|
8
|
+
rescue
|
9
|
+
end
|
7
10
|
end
|
data/lib/test_notifier/rspec.rb
CHANGED
@@ -7,17 +7,20 @@ class Spec::Runner::Formatter::BaseTextFormatter
|
|
7
7
|
def dump_summary(duration, examples, failed, pending)
|
8
8
|
dump_summary_original(duration, examples, failed, pending)
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
begin
|
11
|
+
return if examples == 0
|
12
|
+
|
13
|
+
if failed > 0
|
14
|
+
title = TestNotifier::FAILURE_TITLE
|
15
|
+
image = TestNotifier::ERROR_IMAGE
|
16
|
+
else
|
17
|
+
title = TestNotifier::PASSED_TITLE
|
18
|
+
image = TestNotifier::PASSED_IMAGE
|
19
|
+
end
|
20
|
+
|
21
|
+
message = "#{examples} examples, #{failed} failed, #{pending} pending"
|
22
|
+
TestNotifier::notify(image, title, message)
|
23
|
+
rescue
|
18
24
|
end
|
19
|
-
|
20
|
-
message = "#{examples} examples, #{failed} failed, #{pending} pending"
|
21
|
-
TestNotifier.notify(image, title, message)
|
22
25
|
end
|
23
26
|
end
|
@@ -1,20 +1,16 @@
|
|
1
1
|
require 'test_notifier'
|
2
2
|
require 'test/unit/ui/console/testrunner'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
module UI
|
7
|
-
module Console
|
8
|
-
class TestRunner
|
9
|
-
alias finished_original finished
|
4
|
+
class Test::Unit::UI::Console::TestRunner
|
5
|
+
alias finished_original finished
|
10
6
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
def finished(elapsed_time)
|
8
|
+
finished_original(elapsed_time)
|
9
|
+
|
10
|
+
begin
|
11
|
+
content = @result.to_s
|
12
|
+
TestNotifier.notification_for_test_unit(content)
|
13
|
+
rescue
|
18
14
|
end
|
19
15
|
end
|
20
16
|
end
|
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.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-01-
|
12
|
+
date: 2008-01-18 00:00:00 -02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|