minitest-wscolor 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2011 William H. St. Clair
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # minitest/wscolor
2
+
3
+ `minitest/wscolor` is my test colorizer for MiniTest. I wrote it because I couldn't find
4
+ anything that worked and wasn't stupid (e.g., `minitest/pride`).
5
+
6
+ To use it, add `require 'minitest/minicolor'` to your `test_helper.rb`.
@@ -0,0 +1,47 @@
1
+ require 'minitest/unit'
2
+
3
+ class WSColor
4
+ attr_reader :io
5
+
6
+ def initialize io
7
+ @io = io
8
+ end
9
+
10
+ def print o
11
+ case o
12
+ when '.'
13
+ io.print "\e[32m#{o}\e[0m"
14
+ when 'E'
15
+ io.print "\e[33m#{o}\e[0m"
16
+ when 'F'
17
+ io.print "\e[31m#{o}\e[0m"
18
+ end
19
+ end
20
+
21
+ def puts *a
22
+ output = a.collect do |out|
23
+ case out
24
+ when /(0 failures, 0 errors, 0 skips)/
25
+ out.sub($&, "\e[32m#{$&}\e[0m")
26
+ when /(\d+ failures), (\d+ errors), (\d+ skips)/
27
+ md = $~
28
+ out.sub(md[1], "\e[31m#{md[1]}\e[0m").sub(md[2], "\e[33m#{md[2]}\e[0m").sub(md[3], "\e[36m#{md[3]}\e[0m")
29
+ when /Failure/
30
+ out.sub(out, "\e[31m#{out}\e[0m")
31
+ when /Error/
32
+ out.sub(out, "\e[33m#{out}\e[0m")
33
+ when /Skipped/
34
+ out.sub(out, "\e[36m#{out}\e[0m")
35
+ else
36
+ out
37
+ end
38
+ end
39
+ io.puts *output
40
+ end
41
+
42
+ def method_missing msg, *args
43
+ io.send(msg, *args)
44
+ end
45
+ end
46
+
47
+ MiniTest::Unit.output = WSColor.new(MiniTest::Unit.output)
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "minitest-wscolor"
3
+ s.license = "MIT"
4
+ s.summary = "Yet another test colorizer."
5
+ s.description = File.read(File.join(File.dirname(__FILE__), "README.md"))
6
+ s.version = "0.0.2"
7
+ s.author = "Will St. Clair"
8
+ s.email = "will@willstclair.com"
9
+ s.homepage = "http://github.com/wsc/minitest-wscolor"
10
+ s.platform = Gem::Platform::RUBY
11
+ s.required_ruby_version = ">= 1.9"
12
+ s.files = Dir["**/**"]
13
+ s.has_rdoc = false
14
+
15
+ s.add_dependency "minitest", ">= 2.3.1"
16
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-wscolor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Will St. Clair
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-06-25 00:00:00.000000000 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: minitest
17
+ requirement: &2153515700 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 2.3.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2153515700
26
+ description: ! '# minitest/wscolor
27
+
28
+
29
+ `minitest/wscolor` is my test colorizer for MiniTest. I wrote it because I couldn''t
30
+ find
31
+
32
+ anything that worked and wasn''t stupid (e.g., `minitest/pride`).
33
+
34
+
35
+ To use it, add `require ''minitest/minicolor''` to your `test_helper.rb`.
36
+
37
+ '
38
+ email: will@willstclair.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - lib/minitest/wscolor.rb
44
+ - LICENSE
45
+ - minitest-wscolor-0.0.2.gem
46
+ - minitest-wscolor.gemspec
47
+ - README.md
48
+ has_rdoc: true
49
+ homepage: http://github.com/wsc/minitest-wscolor
50
+ licenses:
51
+ - MIT
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '1.9'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 1.6.2
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Yet another test colorizer.
74
+ test_files: []