turn 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.meta/version +1 -1
- data/History.txt +6 -0
- data/bin/turn +1 -1
- data/lib/turn/command.rb +6 -0
- data/lib/turn/controller.rb +8 -3
- data/lib/turn/reporters/progress_reporter.rb +1 -1
- data/lib/turn/runners/testrunner.rb +5 -0
- metadata +3 -3
data/.meta/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
data/History.txt
CHANGED
data/bin/turn
CHANGED
data/lib/turn/command.rb
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
# -h --help display this help information
|
8
8
|
# --live don't use loadpath
|
9
9
|
# --log log results to a file
|
10
|
+
# -n --name=PATTERN only run tests that match regexp PATTERN
|
10
11
|
# -I --loadpath=PATHS add given paths to the $LOAD_PATH
|
11
12
|
# -r --requires=PATHS require given paths before running tests
|
12
13
|
#
|
@@ -32,6 +33,7 @@ opts = GetoptLong.new(
|
|
32
33
|
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
|
33
34
|
[ '--live', GetoptLong::NO_ARGUMENT ],
|
34
35
|
[ '--log', GetoptLong::OPTIONAL_ARGUMENT ],
|
36
|
+
[ '--name', '-n', GetoptLong::REQUIRED_ARGUMENT ],
|
35
37
|
[ '--loadpath', '-I', GetoptLong::REQUIRED_ARGUMENT ],
|
36
38
|
[ '--requires', '-r', GetoptLong::REQUIRED_ARGUMENT ],
|
37
39
|
|
@@ -50,6 +52,7 @@ opts = GetoptLong.new(
|
|
50
52
|
|
51
53
|
live = nil
|
52
54
|
log = nil
|
55
|
+
pattern = nil
|
53
56
|
loadpath = []
|
54
57
|
requires = []
|
55
58
|
|
@@ -67,6 +70,8 @@ opts.each do |opt, arg|
|
|
67
70
|
live = true
|
68
71
|
when '--log'
|
69
72
|
log = true
|
73
|
+
when '--name'
|
74
|
+
pattern = Regexp.new(arg, Regexp::IGNORECASE)
|
70
75
|
when '--loadpath'
|
71
76
|
loadpath << arg
|
72
77
|
when '--requires'
|
@@ -126,6 +131,7 @@ controller = Turn::Controller.new do |c|
|
|
126
131
|
c.tests = tests
|
127
132
|
c.runner = runner
|
128
133
|
c.reporter = reporter
|
134
|
+
c.pattern = pattern
|
129
135
|
end
|
130
136
|
|
131
137
|
controller.start
|
data/lib/turn/controller.rb
CHANGED
@@ -28,6 +28,10 @@ module Turn
|
|
28
28
|
# Files globs to specially exclude.
|
29
29
|
attr_accessor :exclude
|
30
30
|
|
31
|
+
# Regexp pattern that all test name's must
|
32
|
+
# match to be eligible to run.
|
33
|
+
attr_accessor :pattern
|
34
|
+
|
31
35
|
# Add these folders to the $LOAD_PATH.
|
32
36
|
attr_accessor :loadpath
|
33
37
|
|
@@ -64,11 +68,12 @@ module Turn
|
|
64
68
|
@loadpath ||= ['lib']
|
65
69
|
@tests ||= "test/**/{test,}*{,test}"
|
66
70
|
@exclude ||= []
|
67
|
-
@
|
71
|
+
@requires ||= []
|
68
72
|
@live ||= false
|
69
73
|
@log ||= true
|
70
74
|
@reporter ||= OutlineReporter.new($stdout)
|
71
75
|
@runner ||= TestRunner.new
|
76
|
+
@pattern ||= /.*/
|
72
77
|
end
|
73
78
|
|
74
79
|
# Collect test configuation.
|
@@ -109,8 +114,8 @@ module Turn
|
|
109
114
|
@exclude = list_option(paths)
|
110
115
|
end
|
111
116
|
|
112
|
-
def
|
113
|
-
@
|
117
|
+
def requires=(paths)
|
118
|
+
@requires = list_option(paths)
|
114
119
|
end
|
115
120
|
|
116
121
|
def files
|
@@ -34,6 +34,11 @@ module Turn
|
|
34
34
|
suite = Test::Unit::TestSuite.new('') # FIXME: Name?
|
35
35
|
sub_suites.sort_by{|s|s.name}.each{|s| suite << s}
|
36
36
|
|
37
|
+
suite.tests.each do |c|
|
38
|
+
pattern = controller.pattern
|
39
|
+
c.tests.reject! { |t| pattern !~ t.method_name }
|
40
|
+
end
|
41
|
+
|
37
42
|
@t_reporter = controller.reporter
|
38
43
|
|
39
44
|
super(suite, output_level, $stdout)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-13 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
43
|
+
version: 1.1.0
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: bones
|