detroit-minitest 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Profile ADDED
@@ -0,0 +1,23 @@
1
+ ---
2
+ name : detroit-minitest
3
+ version : 0.1.0
4
+ title : Detroit MiniTest
5
+ summary : MiniTest plugin for Detroit
6
+
7
+ description:
8
+ Detroit MiniTest is a plugin for the Detroit build system for
9
+ runing MiniTest-based tests during the standard test phase.
10
+ Can also be used as a stand-alone tool in Ruby scripts.
11
+
12
+ authors:
13
+ - Thomas Sawyer <transfire@gmail.com>
14
+
15
+ resources:
16
+ home: http://detroit.github.com/
17
+ code: http://github.com/detroit/detroit-minitest
18
+
19
+ copyrights:
20
+ - (c) 2011 Thomas Sawyer, Rubyworks (GPL3)
21
+
22
+ source: Profile
23
+
data/README.rdoc ADDED
@@ -0,0 +1,21 @@
1
+ = Detroit MiniTest Tool
2
+
3
+
4
+ == DESCRIPTION
5
+
6
+ MiniTest test runner tool can run your Ruby tests.
7
+
8
+
9
+ == INSTALL
10
+
11
+ $ gem install detroit-minitest
12
+
13
+
14
+ == COPYRIGHT
15
+
16
+ Copyright (c) 2011 Thomas Sawyer
17
+
18
+ GPL v.3 license
19
+
20
+ See COPYING.rdoc and GPL3.txt file for details.
21
+
@@ -0,0 +1,127 @@
1
+ require 'detroit/tool'
2
+
3
+ module Detroit
4
+
5
+ # Convenience method for creating a new MiniTest instance.
6
+ def MiniTest(options={})
7
+ MiniTest.new(options)
8
+ end
9
+
10
+ # The MiniTest tool runs tests. For Ruby 1.9+ `minitest/autorun` is
11
+ # used to run the tests. For older versions of Ruby, `test/unit` is used.
12
+ #
13
+ class MiniTest < Tool
14
+
15
+ # By default look for tests in test directory.
16
+ DEFAULT_TESTS = ['test/*_test.rb', 'test/test_*.rb']
17
+
18
+ # A T T R I B U T E S
19
+
20
+ # Test files to include.
21
+ attr_reader :tests
22
+
23
+ #
24
+ def tests=(paths)
25
+ @tests = [paths].flatten
26
+ end
27
+
28
+ # Test files or globs to ignore.
29
+ attr_reader :exclude
30
+
31
+ #
32
+ def exclude=(paths)
33
+ @exclude = [paths].flatten
34
+ end
35
+
36
+ # Test files to ignore by matching filename.
37
+ attr_reader :ignore
38
+
39
+ #
40
+ def ignore=(paths)
41
+ @ignore = [paths].flatten
42
+ end
43
+
44
+ #
45
+ attr_reader :loadpath
46
+
47
+ #
48
+ def loadpath=(paths)
49
+ @loadpath = [paths].flatten
50
+ end
51
+
52
+ #
53
+ attr_reader :requires
54
+
55
+ #
56
+ def requires=(paths)
57
+ @requires = [paths].flatten
58
+ end
59
+
60
+ #
61
+ attr_accessor :extra
62
+
63
+ # A S S E M B L Y S T A T I O N S
64
+
65
+ #
66
+ def station_test
67
+ test
68
+ end
69
+
70
+ # S E R V I C E M E T H O D S
71
+
72
+ # Run tests.
73
+ def test
74
+ requires = [autorunner] + self.requires
75
+
76
+ cmd = []
77
+ loadpath.each do |path|
78
+ cmd << "-I#{path}"
79
+ end
80
+ requires.each do |path|
81
+ cmd << "-r#{path}"
82
+ end
83
+ cmd << "-e '%w{" + resolved_tests.join(' ') + "}.each{ |f| require f }'"
84
+ cmd << extra.to_s if extra
85
+
86
+ success = ruby(cmd.join(' '))
87
+
88
+ abort "Aborted due to test failures. Use --force to override." unless success or force?
89
+ end
90
+
91
+ private
92
+
93
+ #
94
+ def initialize_defaults
95
+ @tests = DEFAULT_TESTS
96
+ @exclude = []
97
+ @ignore = []
98
+ @loadpath = []
99
+ @requires = []
100
+ end
101
+
102
+ # Resolve test globs.
103
+ def resolved_tests
104
+ @resolved_tests ||= (
105
+ list = amass(tests, exclude, ignore)
106
+ list.map{ |f| "./#{f}" }
107
+ )
108
+ end
109
+
110
+ #
111
+ def autorunner
112
+ if RUBY_VERSION < '1.9'
113
+ 'test/unit'
114
+ else
115
+ 'minitest/autorun'
116
+ end
117
+ end
118
+
119
+ public
120
+
121
+ def self.man_page
122
+ File.dirname(__FILE__)+'/../man/detroit-minitest.5'
123
+ end
124
+
125
+ end
126
+
127
+ end
@@ -0,0 +1,71 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "DETROIT\-MINITEST" "5" "October 2011" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBdetroit\-minitest\fR \- ruby minitest\-based test via detroit
8
+ .
9
+ .SH "DESCRIPTION"
10
+ MiniTest test runner tool can run your Ruby tests during the standard test phase\.
11
+ .
12
+ .SH "OPTIONS"
13
+ The following options can be used in the Detroit assembly file for defining a MiniTest service\.
14
+ .
15
+ .IP "\(bu" 4
16
+ \fBtests\fR \- Test files to include\.
17
+ .
18
+ .IP "\(bu" 4
19
+ \fBexclude\fR \- Files or globs to exclude\.
20
+ .
21
+ .IP "\(bu" 4
22
+ \fBignore\fR \- Files to ignore by matching filename\.
23
+ .
24
+ .IP "\(bu" 4
25
+ \fBloadpath\fR \- Directories to add to\fB$LOAD_PATH\fR\. Defaults to \fB[\'lib\']\fR\.
26
+ .
27
+ .IP "\(bu" 4
28
+ \fBrequires\fR \- Scripts to require before running tests\.
29
+ .
30
+ .IP "\(bu" 4
31
+ \fBextra\fR \- Extra command line options to append to command\.
32
+ .
33
+ .IP "" 0
34
+ .
35
+ .SH "EXAMPLES"
36
+ A typical example would look something like:
37
+ .
38
+ .IP "" 4
39
+ .
40
+ .nf
41
+
42
+ minitest:
43
+ tests: spec/*_spec\.rb
44
+ loadpath:
45
+ \- lib
46
+ \- spec
47
+ extra: \'| tapout pretty\'
48
+ .
49
+ .fi
50
+ .
51
+ .IP "" 0
52
+ .
53
+ .SH "RESOURCES"
54
+ For more information:
55
+ .
56
+ .IP "\(bu" 4
57
+ API Documentation \fIhttp://rubydoc\.info/gems/detroit\-minitest\fR
58
+ .
59
+ .IP "\(bu" 4
60
+ Development Site \fIhttp://github\.com/detroit/detroit\-minitest\fR
61
+ .
62
+ .IP "" 0
63
+ .
64
+ .SH "COPYRIGHT"
65
+ Copyright (c) 2010 Thomas Sawyer, Rubyworks
66
+ .
67
+ .P
68
+ Detroit MiniTest is distributable in accordance with the GPLv3 license\.
69
+ .
70
+ .SH "SEE ALSO"
71
+ detroit(1), ruby(1)
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>detroit-minitest(5) - ruby minitest-based test via detroit</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ </head>
45
+ <!--
46
+ The following styles are deprecated and will be removed at some point:
47
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
48
+
49
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
50
+ .man-navigation should be used instead.
51
+ -->
52
+ <body id='manpage'>
53
+ <div class='mp' id='man'>
54
+
55
+ <div class='man-navigation' style='display:none'>
56
+ <a href="#NAME">NAME</a>
57
+ <a href="#DESCRIPTION">DESCRIPTION</a>
58
+ <a href="#OPTIONS">OPTIONS</a>
59
+ <a href="#EXAMPLES">EXAMPLES</a>
60
+ <a href="#RESOURCES">RESOURCES</a>
61
+ <a href="#COPYRIGHT">COPYRIGHT</a>
62
+ <a href="#SEE-ALSO">SEE ALSO</a>
63
+ </div>
64
+
65
+ <ol class='man-decor man-head man head'>
66
+ <li class='tl'>detroit-minitest(5)</li>
67
+ <li class='tc'></li>
68
+ <li class='tr'>detroit-minitest(5)</li>
69
+ </ol>
70
+
71
+ <h2 id="NAME">NAME</h2>
72
+ <p class="man-name">
73
+ <code>detroit-minitest</code> - <span class="man-whatis">ruby minitest-based test via detroit</span>
74
+ </p>
75
+
76
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
77
+
78
+ <p>MiniTest test runner tool can run your Ruby tests during the
79
+ standard test phase.</p>
80
+
81
+ <h2 id="OPTIONS">OPTIONS</h2>
82
+
83
+ <p>The following options can be used in the Detroit assembly file
84
+ for defining a MiniTest service.</p>
85
+
86
+ <ul>
87
+ <li><p><code>tests</code> - Test files to include.</p></li>
88
+ <li><p><code>exclude</code> - Files or globs to exclude.</p></li>
89
+ <li><p><code>ignore</code> - Files to ignore by matching filename.</p></li>
90
+ <li><p><code>loadpath</code> - Directories to add to<code>$LOAD_PATH</code>. Defaults to <code>['lib']</code>.</p></li>
91
+ <li><p><code>requires</code> - Scripts to require before running tests.</p></li>
92
+ <li><p><code>extra</code> - Extra command line options to append to command.</p></li>
93
+ </ul>
94
+
95
+
96
+ <h2 id="EXAMPLES">EXAMPLES</h2>
97
+
98
+ <p>A typical example would look something like:</p>
99
+
100
+ <pre><code>minitest:
101
+ tests: spec/*_spec.rb
102
+ loadpath:
103
+ - lib
104
+ - spec
105
+ extra: '| tapout pretty'
106
+ </code></pre>
107
+
108
+ <h2 id="RESOURCES">RESOURCES</h2>
109
+
110
+ <p>For more information:</p>
111
+
112
+ <ul>
113
+ <li><p><a href="http://rubydoc.info/gems/detroit-minitest">API Documentation</a></p></li>
114
+ <li><p><a href="http://github.com/detroit/detroit-minitest">Development Site</a></p></li>
115
+ </ul>
116
+
117
+
118
+ <h2 id="COPYRIGHT">COPYRIGHT</h2>
119
+
120
+ <p>Copyright (c) 2010 Thomas Sawyer, Rubyworks</p>
121
+
122
+ <p>Detroit MiniTest is distributable in accordance with the GPLv3 license.</p>
123
+
124
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
125
+
126
+ <p><span class="man-ref">detroit<span class="s">(1)</span></span>, <span class="man-ref">ruby<span class="s">(1)</span></span></p>
127
+
128
+
129
+ <ol class='man-decor man-foot man foot'>
130
+ <li class='tl'></li>
131
+ <li class='tc'>October 2011</li>
132
+ <li class='tr'>detroit-minitest(5)</li>
133
+ </ol>
134
+
135
+ </div>
136
+ </body>
137
+ </html>
@@ -0,0 +1,58 @@
1
+ detroit-minitest(5) - ruby minitest-based test via detroit
2
+ ==========================================================
3
+
4
+ ## DESCRIPTION
5
+
6
+ MiniTest test runner tool can run your Ruby tests during the
7
+ standard test phase.
8
+
9
+
10
+ ## OPTIONS
11
+
12
+ The following options can be used in the Detroit assembly file
13
+ for defining a MiniTest service.
14
+
15
+ * `tests` - Test files to include.
16
+
17
+ * `exclude` - Files or globs to exclude.
18
+
19
+ * `ignore` - Files to ignore by matching filename.
20
+
21
+ * `loadpath` - Directories to add to`$LOAD_PATH`. Defaults to `['lib']`.
22
+
23
+ * `requires` - Scripts to require before running tests.
24
+
25
+ * `extra` - Extra command line options to append to command.
26
+
27
+
28
+ ## EXAMPLES
29
+
30
+ A typical example would look something like:
31
+
32
+ minitest:
33
+ tests: spec/*_spec.rb
34
+ loadpath:
35
+ - lib
36
+ - spec
37
+ extra: '| tapout pretty'
38
+
39
+
40
+ ## RESOURCES
41
+
42
+ For more information:
43
+
44
+ * [API Documentation](http://rubydoc.info/gems/detroit-minitest)
45
+
46
+ * [Development Site](http://github.com/detroit/detroit-minitest)
47
+
48
+
49
+ ## COPYRIGHT
50
+
51
+ Copyright (c) 2010 Thomas Sawyer, Rubyworks
52
+
53
+ Detroit MiniTest is distributable in accordance with the GPLv3 license.
54
+
55
+
56
+ ## SEE ALSO
57
+
58
+ detroit(1), ruby(1)
data/site/index.html ADDED
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>detroit-minitest(5) - ruby minitest-based test via detroit</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ </head>
45
+ <!--
46
+ The following styles are deprecated and will be removed at some point:
47
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
48
+
49
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
50
+ .man-navigation should be used instead.
51
+ -->
52
+ <body id='manpage'>
53
+ <div class='mp' id='man'>
54
+
55
+ <div class='man-navigation' style='display:none'>
56
+ <a href="#NAME">NAME</a>
57
+ <a href="#DESCRIPTION">DESCRIPTION</a>
58
+ <a href="#OPTIONS">OPTIONS</a>
59
+ <a href="#EXAMPLES">EXAMPLES</a>
60
+ <a href="#RESOURCES">RESOURCES</a>
61
+ <a href="#COPYRIGHT">COPYRIGHT</a>
62
+ <a href="#SEE-ALSO">SEE ALSO</a>
63
+ </div>
64
+
65
+ <ol class='man-decor man-head man head'>
66
+ <li class='tl'>detroit-minitest(5)</li>
67
+ <li class='tc'></li>
68
+ <li class='tr'>detroit-minitest(5)</li>
69
+ </ol>
70
+
71
+ <h2 id="NAME">NAME</h2>
72
+ <p class="man-name">
73
+ <code>detroit-minitest</code> - <span class="man-whatis">ruby minitest-based test via detroit</span>
74
+ </p>
75
+
76
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
77
+
78
+ <p>MiniTest test runner tool can run your Ruby tests during the
79
+ standard test phase.</p>
80
+
81
+ <h2 id="OPTIONS">OPTIONS</h2>
82
+
83
+ <p>The following options can be used in the Detroit assembly file
84
+ for defining a MiniTest service.</p>
85
+
86
+ <ul>
87
+ <li><p><code>tests</code> - Test files to include.</p></li>
88
+ <li><p><code>exclude</code> - Files or globs to exclude.</p></li>
89
+ <li><p><code>ignore</code> - Files to ignore by matching filename.</p></li>
90
+ <li><p><code>loadpath</code> - Directories to add to<code>$LOAD_PATH</code>. Defaults to <code>['lib']</code>.</p></li>
91
+ <li><p><code>requires</code> - Scripts to require before running tests.</p></li>
92
+ <li><p><code>extra</code> - Extra command line options to append to command.</p></li>
93
+ </ul>
94
+
95
+
96
+ <h2 id="EXAMPLES">EXAMPLES</h2>
97
+
98
+ <p>A typical example would look something like:</p>
99
+
100
+ <pre><code>minitest:
101
+ tests: spec/*_spec.rb
102
+ loadpath:
103
+ - lib
104
+ - spec
105
+ extra: '| tapout pretty'
106
+ </code></pre>
107
+
108
+ <h2 id="RESOURCES">RESOURCES</h2>
109
+
110
+ <p>For more information:</p>
111
+
112
+ <ul>
113
+ <li><p><a href="http://rubydoc.info/gems/detroit-minitest">API Documentation</a></p></li>
114
+ <li><p><a href="http://github.com/detroit/detroit-minitest">Development Site</a></p></li>
115
+ </ul>
116
+
117
+
118
+ <h2 id="COPYRIGHT">COPYRIGHT</h2>
119
+
120
+ <p>Copyright (c) 2010 Thomas Sawyer, Rubyworks</p>
121
+
122
+ <p>Detroit MiniTest is distributable in accordance with the GPLv3 license.</p>
123
+
124
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
125
+
126
+ <p><span class="man-ref">detroit<span class="s">(1)</span></span>, <span class="man-ref">ruby<span class="s">(1)</span></span></p>
127
+
128
+
129
+ <ol class='man-decor man-foot man foot'>
130
+ <li class='tl'></li>
131
+ <li class='tc'>October 2011</li>
132
+ <li class='tr'>detroit-minitest(5)</li>
133
+ </ol>
134
+
135
+ </div>
136
+ </body>
137
+ </html>