Class: Detroit::MiniTest
- Inherits:
-
Tool
- Object
- Tool
- Detroit::MiniTest
- Defined in:
- lib/detroit-minitest.rb
Overview
The MiniTest tool runs tests. For Ruby 1.9+ ‘minitest/autorun` is used to run the tests. For older versions of Ruby, `test/unit` is used.
Constant Summary collapse
- DEFAULT_TESTS =
By default look for tests in test directory.
['test/*_test.rb', 'test/test_*.rb']
Instance Attribute Summary collapse
-
#exclude ⇒ Object
Test files or globs to ignore.
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#ignore ⇒ Object
Test files to ignore by matching filename.
-
#loadpath ⇒ Object
Returns the value of attribute loadpath.
-
#requires ⇒ Object
Returns the value of attribute requires.
-
#tests ⇒ Object
Test files to include.
Class Method Summary collapse
Instance Method Summary collapse
- #assemble(station, options = {}) ⇒ Object
- #assemble?(station, options = {}) ⇒ Boolean
-
#test ⇒ Object
Run tests.
Instance Attribute Details
#exclude ⇒ Object
Test files or globs to ignore.
29 30 31 |
# File 'lib/detroit-minitest.rb', line 29 def exclude @exclude end |
#extra ⇒ Object
Returns the value of attribute extra.
61 62 63 |
# File 'lib/detroit-minitest.rb', line 61 def extra @extra end |
#ignore ⇒ Object
Test files to ignore by matching filename.
37 38 39 |
# File 'lib/detroit-minitest.rb', line 37 def ignore @ignore end |
#loadpath ⇒ Object
Returns the value of attribute loadpath.
45 46 47 |
# File 'lib/detroit-minitest.rb', line 45 def loadpath @loadpath end |
#requires ⇒ Object
Returns the value of attribute requires.
53 54 55 |
# File 'lib/detroit-minitest.rb', line 53 def requires @requires end |
#tests ⇒ Object
Test files to include.
21 22 23 |
# File 'lib/detroit-minitest.rb', line 21 def tests @tests end |
Class Method Details
.man_page ⇒ Object
132 133 134 |
# File 'lib/detroit-minitest.rb', line 132 def self.man_page File.dirname(__FILE__)+'/../man/detroit-minitest.5' end |
Instance Method Details
#assemble(station, options = {}) ⇒ Object
74 75 76 77 78 |
# File 'lib/detroit-minitest.rb', line 74 def assemble(station, ={}) case station when :test then test end end |
#assemble?(station, options = {}) ⇒ Boolean
67 68 69 70 71 |
# File 'lib/detroit-minitest.rb', line 67 def assemble?(station, ={}) case station when :test then true end end |
#test ⇒ Object
Run tests.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/detroit-minitest.rb', line 84 def test requires = [autorunner] + self.requires cmd = [] loadpath.each do |path| cmd << "-I#{path}" end requires.each do |path| cmd << "-r#{path}" end cmd << "-e '%w{" + resolved_tests.join(' ') + "}.each{ |f| require f }'" cmd << extra.to_s if extra success = ruby(cmd.join(' ')) abort "Aborted due to test failures. Use --force to override." unless success or force? end |