turn 0.8.2 → 0.9.7

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.
Files changed (52) hide show
  1. data/CONTRIBUTING.md +40 -0
  2. data/History.txt +81 -1
  3. data/Index.rb +34 -0
  4. data/LICENSE.txt +21 -0
  5. data/NOTICE.md +12 -0
  6. data/README.md +176 -0
  7. data/Release.txt +21 -1
  8. data/Version.txt +1 -1
  9. data/bin/turn +8 -2
  10. data/lib/turn/autoload.rb +6 -0
  11. data/lib/turn/autorun.rb +4 -0
  12. data/lib/turn/bin.rb +8 -2
  13. data/lib/turn/colorize.rb +50 -19
  14. data/lib/turn/command.rb +102 -39
  15. data/lib/turn/components/case.rb +7 -2
  16. data/lib/turn/components/method.rb +13 -2
  17. data/lib/turn/components/suite.rb +15 -6
  18. data/lib/turn/components.rb +4 -0
  19. data/lib/turn/configuration.rb +271 -0
  20. data/lib/turn/controller.rb +18 -176
  21. data/lib/turn/decorators/topten_decorator.rb +67 -0
  22. data/lib/turn/minitest.rb +25 -0
  23. data/lib/turn/reporter.rb +75 -13
  24. data/lib/turn/reporters/cue_reporter.rb +27 -11
  25. data/lib/turn/reporters/dot_reporter.rb +24 -28
  26. data/lib/turn/reporters/outline_reporter.rb +76 -39
  27. data/lib/turn/reporters/pretty_reporter.rb +110 -129
  28. data/lib/turn/reporters/progress_reporter.rb +70 -33
  29. data/lib/turn/runners/crossrunner.rb +2 -2
  30. data/lib/turn/runners/isorunner.rb +12 -10
  31. data/lib/turn/runners/minirunner.rb +51 -81
  32. data/lib/turn/runners/solorunner.rb +0 -1
  33. data/lib/turn/runners/testrunner.rb +12 -15
  34. data/lib/turn/testunit.rb +24 -0
  35. data/lib/turn/version.rb +1 -1
  36. data/lib/turn.rb +10 -15
  37. data/test/helper.rb +81 -5
  38. data/test/reporter_test.rb +35 -0
  39. data/test/test_framework.rb +81 -38
  40. data/test/test_reporters.rb +14 -14
  41. data/test/test_runners.rb +57 -19
  42. data/{demo → try}/test_autorun_minitest.rb +5 -4
  43. data/{demo → try}/test_autorun_testunit.rb +1 -2
  44. metadata +135 -112
  45. data/README.txt +0 -116
  46. data/Rakefile +0 -39
  47. data/lib/turn/autorun/minitest.rb +0 -173
  48. data/lib/turn/autorun/testunit.rb +0 -116
  49. data/turn.gemspec +0 -49
  50. /data/{demo → try}/test_counts.rb +0 -0
  51. /data/{demo → try}/test_sample.rb +0 -0
  52. /data/{demo → try}/test_sample2.rb +0 -0
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,40 @@
1
+ # CONTRIBUTING
2
+
3
+ 1. Fork it
4
+ 2. Create your feature branch (`git checkout -b my_new_feature`)
5
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
6
+ 4. Push to the branch (`git push origin my_new_feature`)
7
+ 5. Create a new Pull Request
8
+
9
+ If you are a project member please follow the same process (minus the forking). For significant changes please wait for another developer to review and merge them, whereas small contributions/fixes can be merged without review. The recommended naming scheme for feature branches is 'feature\_name\_$1\_`date +"%Y%m%d"`'.
10
+
11
+ You may want to look into the [grb](http://github.com/jinzhu/grb) gem for easier handling of remote branches.
12
+
13
+
14
+ ## Building
15
+
16
+ NOTE: The process described here will change sooner than later.
17
+
18
+ Turn uses the Indexer and Mast gems to simplify project building.
19
+
20
+ The Indexer gem defines a strict structure for project metadata. Use the `index`
21
+ command to build the `.index` file from the editable `Index.rb` source.
22
+ The `.gemspec` file is written to get the information it needs from the `.index`
23
+ file. To build a gem simply use `gem build .gemspec`.
24
+
25
+ The `mast` command is used to keep an up-to-date `Manifest.txt` file. The gemspec
26
+ uses this file to determine which files to include in the gem. Just use
27
+ `mast -u` to update it. The top line in the Manifest.txt file determines it's
28
+ contents.
29
+
30
+
31
+ ## Solo and Cross Runners
32
+
33
+ An important aspect of Turn's design that needs be kept in mind, is the way
34
+ _solo_ and _cross_ testing features are implemented. This is some really
35
+ neat code actually (IMO), but it might be difficult to grasp with out some
36
+ explanation. What turn does when using the `--solo` or `--cross` options,
37
+ is <i>shell out to itself</i> using the YAML reporter. It does this repeatedly
38
+ for each test, or each pair of tests, respectively, and then collates all the
39
+ resulting YAML reports into a single report, which it then feeds back into the
40
+ selected reporter.
data/History.txt CHANGED
@@ -1,5 +1,85 @@
1
+ === 0.9.7 / 2014-03-14
2
+ * Fix -n option for running named tests (#78)
3
+ * Change default output mode to 'pretty'
4
+ * Add option to print top 10 longest running tests
5
+ * Fix home directory lookup
6
+
7
+ === 0.9.6 / 2012-06-26
8
+ * Override output() instead of changeing @@out. (#96,#97)
9
+ * Update install instructions in README. (#95)
10
+ * Fix bug in gemspec that interfered with Bundler (#93)
11
+
12
+ == 0.9.5 / 2012-04-15
13
+ * Add -m/-mark option to flag tests with high runtimes.
14
+ * Show per-test runtime in Pretty reporter. (#83)
15
+ * Fix colorization of result box. (Don Wilson) (#81, #85)
16
+ * Add support for natural test names in pretty format. (Don Wilson) (#86)
17
+ * Fix test rake task on Windows. (Don Wilson) (#88)
18
+
19
+ == 0.9.4 / 2012-03-16
20
+ * Fix dot reporter to use `.` instead of `S` for passed tests.
21
+ * Do not filter backtraces of local directory.
22
+ * Do not colourize zero counts in pretty reporter.
23
+
24
+ == 0.9.3 / 2012-02-17
25
+ * Default to pretty reporter.
26
+ * Can set reporter via `rpt` environment variable.
27
+ * Fix backtrace filter.
28
+ * Fix require warning when using cli.
29
+ * Add skip counts to reporter tallies. (y8)
30
+ * Improve Pretty reporter output. (y8)
31
+
32
+ == 0.9.2 / 2012-02-08
33
+ * Fix colorization config issue.
34
+ * Switch to simple dotruby build system.
35
+
36
+ == 0.9.1 / 2012-02-01
37
+ * MiniTest Only
38
+ * Fix issues with 1.8.7 support.
39
+
40
+ == 0.9.0 / 2012-01-30
41
+ * Fix bundle exec issue, which means...
42
+ * Developer's must require `turn/autorun` instead fo just `turn`.
43
+ * Improve detection of TestUnit 1.x vs. MiniTest
44
+ * Show randomization seed number in output.
45
+ * Pretty format option is now `-R` instead of `-T`.
46
+ * Rename case match shortcut to `-c` instead of `-t`.
47
+ * Add support for skipped tests.
48
+ * Support max backtrace limit via `-b` option.
49
+ * Use $RUBY_IGNORE_CALLERS to ignore lines of backtrace.
50
+ * Better color support on Windows (install ANSICON)
51
+ * MiniTest is a dependency (even if you are using it for TestUnit 1.x).
52
+
53
+ == 0.8.4 / 2011-11-11
54
+ * Now must use MiniTest 2.0+.
55
+
56
+ == 0.8.3 / 2011-10-10
57
+ * Merge pull request #56 from codeinvain/master
58
+ * Merge pull request #52 from markburns/patch-2
59
+ * Merge pull request #51 from markburns/patch-1
60
+ * Merge pull request #50 from tpope/stdout_tty
61
+ * Switch COLORIZE to method for easier testing
62
+ * Don't show colors if stdout is not a tty
63
+ * Use global config.
64
+ * Autoload Test::Unit and MiniTest.
65
+ * Autorun uses Turn's runner classes.
66
+ * minitest changed Unit#run, set Unit.runner= if method exists
67
+ * Merge pull request #39 from dubek/fix_term_detection_for_ruby_19
68
+ * Merge pull request #38 from cameel/fix-minitest-run-monkeypatch-no-trace
69
+ * Merge pull request #36 from yalab/master
70
+ * Don't use ANSI codes on dumb terminals in Ruby 1.9
71
+ * Make Turn work with gems that monkey-patch MiniTest::Unit::TestCase.run()
72
+ * Fixed pretty_reporter to use 'trace' option.
73
+ * Fixed dot_reporter to use 'trace' option.
74
+ * Fixed outline_reporter to use 'trace' option.
75
+ * Add -t or --trace option for display all stacktrace.
76
+ * missing #skip! method in TestMethod
77
+ * Merge branch 'master' of github.com:TwP/turn
78
+ * use autoload to load MiniTests emulation of TestUnit
79
+ * do not use color if in a VIM session
80
+
1
81
  == 0.8.2 / 2011-03-31
2
- * Add version in code and cli option to diplay it.
82
+ * Add version in code and cli option to display it.
3
83
  * Fix for files lookup controller bug
4
84
  * Limit default test matching to *.rb files.
5
85
  * Show first line from the test file when showing stack traces [F. Morgan Whitney]
data/Index.rb ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/lib/turn/version'
4
+
5
+ version Turn::VERSION #File.read('Version.txt').strip
6
+
7
+ name 'turn'
8
+ title 'Turn'
9
+ summary 'Test Reporters (New) -- new output formats for Testing'
10
+
11
+ description "Turn provides a set of alternative runners for MiniTest, both colorful and informative."
12
+
13
+ authors [
14
+ 'Thomas Sawyer <transfire@gmail.com>',
15
+ 'Tim Pease <tim.pease@gmail.com>'
16
+ ]
17
+
18
+ requirements [
19
+ 'ansi',
20
+ 'minitest 4~',
21
+ 'rake (build)',
22
+ 'indexer (build)',
23
+ 'mast (build)'
24
+ ]
25
+
26
+ resources(
27
+ 'home' => 'http://rubygems.org/gems/turn',
28
+ 'code' => 'http://github.com/TwP/turn'
29
+ )
30
+
31
+ copyrights [
32
+ '2006 Tim Pease (MIT)',
33
+ '2009 Thomas Sawyer (MIT)'
34
+ ]
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/NOTICE.md ADDED
@@ -0,0 +1,12 @@
1
+ # Copyright Notices
2
+
3
+ ## MiniTest
4
+
5
+ Copyright (c) Ryan Davis, Seattle.rb
6
+
7
+ MIT License
8
+
9
+ Turn tightly couples with MiniTest which means in some cases
10
+ MiniTest code might be reused and modified so Turn will
11
+ interface with MiniTest effectively.
12
+
data/README.md ADDED
@@ -0,0 +1,176 @@
1
+ # TURN - MiniTest Reporters [![Build status](https://api.travis-ci.org/turn-project/turn.png)](https://travis-ci.org/turn-project/turn)
2
+ by Tim Pease
3
+ http://rubygems.org/gems/turn
4
+
5
+ ## DESCRIPTION
6
+
7
+ TURN is a new way to view test results. With longer running tests, it
8
+ can be very frustrating to see a failure (....F...) and then have to wait till
9
+ all the tests finish before you can see what the exact failure was. TURN
10
+ displays each test on a separate line with failures being displayed
11
+ immediately instead of at the end of the tests.
12
+
13
+ If you have the 'ansi' gem installed, then TURN output will be displayed in
14
+ wonderful technicolor (but only if your terminal supports ANSI color codes).
15
+ Well, the only colors are green and red, but that is still color.
16
+
17
+
18
+ ## FEATURES
19
+
20
+ General usage provides better test output. Here is some sample output:
21
+
22
+
23
+ TestMyClass
24
+ test_alt PASS
25
+ test_alt_eq PASS
26
+ test_bad FAIL
27
+ ./test/test_my_class.rb:64:in `test_bad'
28
+ <false> is not true.
29
+ test_foo PASS
30
+ test_foo_eq PASS
31
+ TestYourClass
32
+ test_method_a PASS
33
+ test_method_b PASS
34
+ test_method_c PASS
35
+ ============================================================================
36
+ pass: 7, fail: 1, error: 0
37
+ total: 15 tests with 42 assertions in 0.018 seconds
38
+ ============================================================================
39
+
40
+
41
+ Turn also provides solo and cross test modes when run from the *turn* commandline
42
+ application.
43
+
44
+ ## INSTRUCTION
45
+
46
+ Turn can be used from the command-line or via require. The command-line tool
47
+ offers additional options for how one runs tests.
48
+
49
+ ### Command Line
50
+
51
+ You can use the *turn* executable in place of the *ruby* interpreter.
52
+
53
+ $ turn -Ilib test/test_all.rb
54
+
55
+ This will invoke the ruby interpreter and automatically require the turn
56
+ formatting library. All command line arguments are passed "as is" to the
57
+ ruby interpreter.
58
+
59
+ To use the solo runner.
60
+
61
+ $ turn --solo -Ilib test/
62
+
63
+ This will run all tests in the test/ directory in a separate process.
64
+ Likewise for the cross runner.
65
+
66
+ $ turn --cross -Ilib test/
67
+
68
+ This will run every pairing of tests in a separate process.
69
+
70
+ ### Require
71
+
72
+ Simply require the TURN package from within your test suite.
73
+
74
+ $ require 'turn/autorun'
75
+
76
+ This will configure MiniTest to use TURN formatting for displaying test
77
+ results. A better line to use, though, is the following:
78
+
79
+ begin; require 'turn/autorun'; rescue LoadError; end
80
+
81
+ When you distribute your code, the test suite can be run without requiring
82
+ the end user to install the TURN package.
83
+
84
+ For a Rails application, put the require line into the 'test/test_helper.rb'
85
+ script. Now your Rails tests will use TURN formatting.
86
+
87
+ <b>Note:</b> This changed in version 0.9. It used to be just `require 'turn'`,
88
+ but because of how `bundle exec` works, it was better to require a subdirectory
89
+ file.
90
+
91
+ ### Configuration
92
+
93
+ You can use `Turn.config` to adjust turn configuration.
94
+
95
+ Options are following:
96
+
97
+ tests List of file names or glob patterns of tests to run. Default: ["test/**/{test,}*{,test}.rb"]
98
+ exclude List of file names or globs to exclude from tests list. Default: []
99
+ pattern Regexp pattern that all test names must match to be eligible to run. Default: /.*/ (all)
100
+ matchcase Regexp pattern that all test cases must match to be eligible to run. Default: nil (all)
101
+ loadpath Add these folders to the $LOAD_PATH. Default: ['lib']
102
+ requires Libs to require when running tests. Default: []
103
+ format Reporter type (:pretty, :dot, :cue, :marshal, :outline, :progress). Default: :pretty
104
+ live Test against live install (i.e. Don't use loadpath option). Default: false
105
+ verbose Verbose output? Default: false
106
+ trace Number of backtrace lines to display. Default: set from ENV or nil (all)
107
+ natural Use natural language case names. Default: false
108
+ ansi Force colorized output (requires 'ansi' gem). Default: set from ENV or nil (auto)
109
+
110
+ To set option just call the desired method:
111
+
112
+ Turn.config.format = :progress
113
+
114
+ Also, you can use following environment variables to adjust settings:
115
+
116
+ backtrace Number of backtrace lines to display. Default: set from ENV or nil
117
+ ansi Force colorize output (requires 'ansi' gem).
118
+
119
+ Finally, you can include your own custom Reporter type (aka format). Turn will search for reporters in the `.turn/reporters/`
120
+ directory of your local project and then in your user home directory. So for example, if you specified the following:
121
+
122
+ Turn.config.format = :cool
123
+
124
+ Then Turn will look first for `./.turn/reporters/cool_reporter.rb`, then `~/.turn/reporters/cool_reporter.rb`.
125
+
126
+ See source code for examples of how to write your own reporters.
127
+
128
+
129
+ ## REQUIREMENTS
130
+
131
+ * ansi 1.1+ (for colorized output and progress bar output mode)
132
+
133
+
134
+ ## INSTALLATION
135
+
136
+ Follow the ususal procedure:
137
+
138
+ $ gem install turn
139
+
140
+
141
+ ## TODO
142
+
143
+ * Setup CI for Ruby 1.9 and 2.0
144
+ * Support MiniTest v5.0
145
+ * Remove indexer and mast gems from build process
146
+ * Remove support for Ruby versions < 1.9
147
+ * Remove support for Test::Unit
148
+ * General code cleanup
149
+
150
+
151
+ ## LICENSE
152
+
153
+ MIT License
154
+
155
+ Copyright (c) 2006 Tim Pease
156
+ Copyright (c) 2009 Thomas Sawyer
157
+ Copyright (c) 2013 Michael Kohl, Daniel Yoon
158
+
159
+ Permission is hereby granted, free of charge, to any person obtaining
160
+ a copy of this software and associated documentation files (the
161
+ 'Software'), to deal in the Software without restriction, including
162
+ without limitation the rights to use, copy, modify, merge, publish,
163
+ distribute, sublicense, and/or sell copies of the Software, and to
164
+ permit persons to whom the Software is furnished to do so, subject to
165
+ the following conditions:
166
+
167
+ The above copyright notice and this permission notice shall be
168
+ included in all copies or substantial portions of the Software.
169
+
170
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
171
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
172
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
173
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
174
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
175
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
176
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Release.txt CHANGED
@@ -1,4 +1,24 @@
1
- = Turn 0.8.0
1
+ = Release Notes
2
+
3
+ == 0.9.x
4
+
5
+ The main departure of the 0.9.x series form older version of Turn,
6
+ is that the old TestUnit library (1.x series) is no longer supported.
7
+ Turn is now a MiniTest only library.[1]
8
+
9
+ Among other imporvements, the default reporter is now the Pretty reporter
10
+ instead of the orginal Outline reporter, and MiniTest skips are finally
11
+ supported.
12
+
13
+ Big thanks to y8, Alexey Bondar and others for helpig to get this series
14
+ up to snuff.
15
+
16
+ [1] Note that the old testunit runner is still included in the package
17
+ if it is needed, but no longer will be actively maintained and it
18
+ must be directly required to be used.
19
+
20
+
21
+ == 0.8.x
2
22
 
3
23
  Version 0.8.0 is a fairly significant release for Turn. This release
4
24
  adds support for Ruby 1.9's Minitest framework. You can even use
data/Version.txt CHANGED
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.9.7
data/bin/turn CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
- require 'turn/command'
3
- Turn::Command.main(*ARGV)
2
+ require 'turn'
3
+ begin
4
+ Turn::Command.main(*ARGV)
5
+ rescue StandardError => e
6
+ raise if $DEBUG
7
+ puts e
8
+ exit -1
9
+ end
4
10
 
@@ -0,0 +1,6 @@
1
+ # This is a "dirty trick" to load `test/unit` or `minitest/unit` if sought.
2
+ # Eventually a way to handle this more robustly (without autoreload)
3
+ # should be worked out. But how?
4
+ autoload "Test", 'test/unit'
5
+ autoload "MiniTest", 'minitest/unit'
6
+
@@ -0,0 +1,4 @@
1
+ require 'turn'
2
+
3
+ MiniTest::Unit.autorun
4
+
data/lib/turn/bin.rb CHANGED
@@ -1,4 +1,10 @@
1
1
  $LOAD_PATH.unshift(File.dirname(File.dirname(__FILE__)))
2
- require 'turn/command'
3
- Turn::Command.main(*ARGV)
2
+ require 'turn'
3
+ #begin
4
+ Turn::Command.main(*ARGV)
5
+ #rescue StandardError => e
6
+ # raise if $DEBUG
7
+ # puts e
8
+ # exit -1
9
+ #end
4
10
 
data/lib/turn/colorize.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'turn/configuration' # TODO: why is this needed here?
2
+
3
+ # TODO: adapt for Ruby 1.9+?
1
4
  begin
2
5
  require 'ansi/code'
3
6
  rescue LoadError
@@ -10,56 +13,84 @@ end
10
13
 
11
14
  module Turn
12
15
 
16
+ # Provides a uniform interface for colorizing Turn output.
17
+ #
13
18
  module Colorize
14
19
 
15
- COLORIZE = defined?(::ANSI::Code) && ENV.has_key?('TERM')
20
+ def self.included(base)
21
+ base.module_eval do
22
+ const_set :PASS, Colorize.pass('PASS')
23
+ const_set :FAIL, Colorize.fail('FAIL')
24
+ const_set :ERROR, Colorize.error('ERROR')
25
+ const_set :SKIP, Colorize.skip('SKIP')
26
+ end
27
+ end
28
+
29
+ COLORLESS_TERMINALS = ['dumb']
30
+
31
+ # Colorize output or not?
32
+ def self.colorize?
33
+ return @colorize unless @colorize.nil?
34
+ @colorize ||= (
35
+ ansi = Turn.config.ansi?
36
+ ansi.nil? ? color_supported? : ansi
37
+ )
38
+ end
39
+
40
+ # Does the system support color?
41
+ def self.color_supported?
42
+ return false unless defined?(::ANSI::Code)
43
+ return false unless $stdout.tty?
44
+ return true if ENV.has_key?('TERM') && !COLORLESS_TERMINALS.include?(ENV['TERM'])
45
+ return true if ::RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ && ENV.has_key?('ANSICON')
46
+ return false
47
+ end
16
48
 
17
49
  def self.red(string)
18
- COLORIZE ? ::ANSI::Code.red{ string } : string
50
+ colorize? ? ::ANSI::Code.red{ string } : string
19
51
  end
20
52
 
21
53
  def self.green(string)
22
- COLORIZE ? ::ANSI::Code.green{ string } : string
54
+ colorize? ? ::ANSI::Code.green{ string } : string
23
55
  end
24
56
 
25
57
  def self.blue(string)
26
- COLORIZE ? ::ANSI::Code.blue{ string } : string
58
+ colorize? ? ::ANSI::Code.blue{ string } : string
27
59
  end
28
60
 
29
61
  def self.magenta(string)
30
- COLORIZE ? ::ANSI::Code.magenta{ string } : string
62
+ colorize? ? ::ANSI::Code.magenta{ string } : string
31
63
  end
32
64
 
33
65
  def self.bold(string)
34
- COLORIZE ? ::ANSI::Code.bold{ string } : string
66
+ colorize? ? ::ANSI::Code.bold{ string } : string
67
+ end
68
+
69
+ def self.mark(string)
70
+ colorize? ? ::ANSI::Code.yellow{ string } : string
35
71
  end
36
72
 
37
73
  def self.pass(string)
38
- COLORIZE ? ::ANSI::Code.green{ string } : string
74
+ colorize? ? ::ANSI::Code.green{ string } : string
39
75
  end
40
76
 
41
77
  def self.fail(string)
42
- COLORIZE ? ::ANSI::Code.red{ string } : string
78
+ colorize? ? ::ANSI::Code.red{ string } : string
43
79
  end
44
80
 
45
- #def self.error(string)
46
- # COLORIZE ? ::ANSI::Code.white{ ::ANSI::Code.on_red{ string } } : string
47
- #end
48
-
49
81
  def self.error(string)
50
- COLORIZE ? ::ANSI::Code.yellow{ string } : string
82
+ #colorize? ? ::ANSI::Code.white_on_red{ string } : string
83
+ colorize? ? ::ANSI::Code.yellow{ string } : string
51
84
  end
52
85
 
53
86
  def self.skip(string)
54
- COLORIZE ? ::ANSI::Code.cyan{ string } : string
87
+ colorize? ? ::ANSI::Code.cyan{ string } : string
55
88
  end
56
89
 
57
- PASS = pass('PASS')
58
- FAIL = fail('FAIL')
59
- ERROR = error('ERROR')
60
- SKIP = skip('SKIP')
90
+ def colorize?
91
+ Colorize.colorize?
92
+ end
61
93
 
62
94
  end
63
95
 
64
96
  end
65
-