test-loop 9.1.1 → 9.2.0
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/README.md +16 -0
- data/lib/test/loop/notify.rb +13 -0
- data/lib/test/loop/rails.rb +10 -0
- data/lib/test/loop.rb +2 -3
- metadata +4 -2
data/README.md
CHANGED
@@ -71,6 +71,22 @@ Operation
|
|
71
71
|
* Press Control-C or send the SIGINT signal to quit the test loop.
|
72
72
|
|
73
73
|
|
74
|
+
Configuration Presets
|
75
|
+
---------------------
|
76
|
+
|
77
|
+
The following sub-libraries provide "preset" configurations. To use them,
|
78
|
+
simply add the require() lines shown below to your `.test-loop` file or to
|
79
|
+
your `{test,spec}/{test,spec}_helper.rb` files.
|
80
|
+
|
81
|
+
* Defaults for Ruby on Rails testing:
|
82
|
+
|
83
|
+
require 'test/loop/rails'
|
84
|
+
|
85
|
+
* OSD notifications on test failures:
|
86
|
+
|
87
|
+
require 'test/loop/notify'
|
88
|
+
|
89
|
+
|
74
90
|
Configuration
|
75
91
|
-------------
|
76
92
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'test/loop'
|
2
|
+
|
3
|
+
Test::Loop.after_each_test = lambda do |test_file, log_file, run_status, started_at, elapsed_time|
|
4
|
+
unless run_status.success?
|
5
|
+
title = 'FAIL at %s in %0.1fs' % [started_at.strftime('%r'), elapsed_time]
|
6
|
+
message = test_file
|
7
|
+
Thread.new do # run in background
|
8
|
+
system 'notify-send', '-i', 'dialog-error', title, message or
|
9
|
+
system 'growlnotify', '-a', 'Xcode', '-m', message, title or
|
10
|
+
system 'xmessage', '-timeout', '5', '-title', title, message
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/test/loop.rb
CHANGED
@@ -30,12 +30,11 @@ module Test
|
|
30
30
|
|
31
31
|
Loop.overhead_file_globs = ['{test,spec}/{test,spec}_helper.rb']
|
32
32
|
|
33
|
-
Loop.reabsorb_file_globs = Loop.overhead_file_globs
|
34
|
-
['config/**/*.{rb,yml}', 'Gemfile.lock']
|
33
|
+
Loop.reabsorb_file_globs = Loop.overhead_file_globs.dup
|
35
34
|
|
36
35
|
Loop.test_file_matchers = {
|
37
36
|
# source files that correspond to test files
|
38
|
-
'
|
37
|
+
'lib/**/*.rb' => lambda do |path|
|
39
38
|
extn = File.extname(path)
|
40
39
|
base = File.basename(path, extn)
|
41
40
|
"{test,spec}/**/#{base}_{test,spec}#{extn}"
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: test-loop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 9.
|
5
|
+
version: 9.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Suraj N. Kurapati
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-28 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -47,6 +47,8 @@ files:
|
|
47
47
|
- README.md
|
48
48
|
- bin/test-loop
|
49
49
|
- lib/test/loop.rb
|
50
|
+
- lib/test/loop/rails.rb
|
51
|
+
- lib/test/loop/notify.rb
|
50
52
|
has_rdoc: true
|
51
53
|
homepage: http://github.com/sunaku/test-loop
|
52
54
|
licenses: []
|