minitest-rg 0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +8 -0
- data/{Manifest → .gemtest} +0 -0
- data/CHANGELOG.rdoc +3 -0
- data/LICENSE +20 -0
- data/Manifest.txt +9 -0
- data/README.rdoc +40 -0
- data/Rakefile +17 -12
- data/lib/minitest/rg.rb +32 -0
- data/minitest-rg.gemspec +25 -19
- data/test/test_minitest-rg.rb +24 -0
- metadata +91 -66
- data/VERSION +0 -1
- data/gem.yml +0 -10
- data/lib/minitest-rg.rb +0 -50
- data/tasks/echoe.rake +0 -31
- data/test/test.rb +0 -2
data/.autotest
ADDED
data/{Manifest → .gemtest}
RENAMED
File without changes
|
data/CHANGELOG.rdoc
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Mike Moore
|
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
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
= minitest-rg
|
2
|
+
|
3
|
+
Adds color to your MiniTest output.
|
4
|
+
|
5
|
+
== Install
|
6
|
+
|
7
|
+
gem install minitest-rg
|
8
|
+
|
9
|
+
== Configure
|
10
|
+
|
11
|
+
Add the following to your test helper:
|
12
|
+
|
13
|
+
require 'minitest/rg'
|
14
|
+
|
15
|
+
== Contribute
|
16
|
+
|
17
|
+
http://github.com/blowmage/minitest-rg
|
18
|
+
|
19
|
+
== License
|
20
|
+
|
21
|
+
Copyright (c) 2012 Mike Moore
|
22
|
+
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
24
|
+
a copy of this software and associated documentation files (the
|
25
|
+
"Software"), to deal in the Software without restriction, including
|
26
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
27
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
28
|
+
permit persons to whom the Software is furnished to do so, subject to
|
29
|
+
the following conditions:
|
30
|
+
|
31
|
+
The above copyright notice and this permission notice shall be
|
32
|
+
included in all copies or substantial portions of the Software.
|
33
|
+
|
34
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
35
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
36
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
37
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
38
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
39
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
40
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,17 +1,22 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
end
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
Hoe.plugin :gemspec # `gem install hoe-gemspec`
|
7
|
+
Hoe.plugin :git # `gem install hoe-git`
|
8
|
+
Hoe.plugin :minitest # `gem install hoe-minitest`
|
9
|
+
Hoe.plugins.delete :rubyforge
|
10
|
+
|
11
|
+
Hoe.spec 'minitest-rg' do
|
12
|
+
developer 'Mike Moore', 'mike@blowmage.com'
|
13
|
+
|
14
|
+
self.summary = 'RedGreen for MiniTest'
|
15
|
+
self.description = 'Adds color to your MiniTest output'
|
16
|
+
self.urls = ['http://blowmage.com/minitest-rg']
|
10
17
|
|
11
|
-
|
12
|
-
|
18
|
+
self.readme_file = 'README.rdoc'
|
19
|
+
self.history_file = 'CHANGELOG.rdoc'
|
13
20
|
end
|
14
21
|
|
15
|
-
|
16
|
-
puts ext
|
17
|
-
load ext }
|
22
|
+
# vim: syntax=ruby
|
data/lib/minitest/rg.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "minitest/unit"
|
2
|
+
|
3
|
+
module MiniTest
|
4
|
+
class RG
|
5
|
+
VERSION = "1.0.0"
|
6
|
+
|
7
|
+
COLORS = {
|
8
|
+
'.' => "\e[32m.\e[0m",
|
9
|
+
'E' => "\e[33mE\e[0m",
|
10
|
+
'F' => "\e[31mF\e[0m",
|
11
|
+
'S' => "\e[36mS\e[0m",
|
12
|
+
}
|
13
|
+
|
14
|
+
attr_reader :io, :colors
|
15
|
+
|
16
|
+
def initialize io, colors = COLORS
|
17
|
+
@io = io
|
18
|
+
@colors = colors
|
19
|
+
end
|
20
|
+
|
21
|
+
def print o
|
22
|
+
io.print(colors[o] || o)
|
23
|
+
end
|
24
|
+
|
25
|
+
def method_missing msg, *args
|
26
|
+
return super unless io.respond_to? msg
|
27
|
+
io.send(msg, *args)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
MiniTest::Unit.output = MiniTest::RG.new(MiniTest::Unit.output)
|
data/minitest-rg.gemspec
CHANGED
@@ -1,33 +1,39 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.
|
4
|
+
s.name = "minitest-rg"
|
5
|
+
s.version = "1.0.0.20120728083442"
|
6
6
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
8
|
-
s.authors = ["
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
-
s.extra_rdoc_files = ["
|
13
|
-
s.files = ["
|
14
|
-
s.homepage =
|
15
|
-
s.rdoc_options = ["--
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Mike Moore"]
|
9
|
+
s.date = "2012-07-28"
|
10
|
+
s.description = "Adds color to your MiniTest output"
|
11
|
+
s.email = ["mike@blowmage.com"]
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
|
13
|
+
s.files = [".autotest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/minitest/rg.rb", "minitest-rg.gemspec", "test/test_minitest-rg.rb", ".gemtest"]
|
14
|
+
s.homepage = "http://blowmage.com/minitest-rg"
|
15
|
+
s.rdoc_options = ["--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
17
|
-
s.rubyforge_project =
|
18
|
-
s.rubygems_version =
|
19
|
-
s.summary =
|
17
|
+
s.rubyforge_project = "minitest-rg"
|
18
|
+
s.rubygems_version = "1.8.24"
|
19
|
+
s.summary = "RedGreen for MiniTest"
|
20
|
+
s.test_files = ["test/test_minitest-rg.rb"]
|
20
21
|
|
21
22
|
if s.respond_to? :specification_version then
|
22
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
23
|
s.specification_version = 3
|
24
24
|
|
25
|
-
if Gem::Version.new(Gem::
|
26
|
-
s.
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
s.add_development_dependency(%q<minitest>, ["~> 3.2"])
|
27
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
|
28
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.0"])
|
27
29
|
else
|
28
|
-
s.add_dependency(%q<minitest>, ["
|
30
|
+
s.add_dependency(%q<minitest>, ["~> 3.2"])
|
31
|
+
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
32
|
+
s.add_dependency(%q<hoe>, ["~> 3.0"])
|
29
33
|
end
|
30
34
|
else
|
31
|
-
s.add_dependency(%q<minitest>, ["
|
35
|
+
s.add_dependency(%q<minitest>, ["~> 3.2"])
|
36
|
+
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
37
|
+
s.add_dependency(%q<hoe>, ["~> 3.0"])
|
32
38
|
end
|
33
39
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'minitest/rg'
|
3
|
+
|
4
|
+
describe 'minitest-rg' do
|
5
|
+
# generate passing
|
6
|
+
it "passes" do
|
7
|
+
assert_equal 1, 1, "Pass should be GREEN"
|
8
|
+
end
|
9
|
+
|
10
|
+
# generate failing
|
11
|
+
it "fails" do
|
12
|
+
assert_equal 1, 2, "Failure should be RED"
|
13
|
+
end
|
14
|
+
|
15
|
+
# generate error
|
16
|
+
it "error" do
|
17
|
+
raise "Error should be YELLOW"
|
18
|
+
end
|
19
|
+
|
20
|
+
# generate skip
|
21
|
+
it "skips" do
|
22
|
+
skip "Skip should be CYAN"
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,84 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-rg
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 4
|
8
|
-
version: "0.4"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
9
6
|
platform: ruby
|
10
|
-
authors:
|
11
|
-
-
|
7
|
+
authors:
|
8
|
+
- Mike Moore
|
12
9
|
autorequire:
|
13
10
|
bindir: bin
|
14
11
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
dependencies:
|
19
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-07-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
20
15
|
name: minitest
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.2'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rdoc
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.10'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.10'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: hoe
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :development
|
21
55
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
description: redgreen minitest
|
32
|
-
email: eno-pboy@open-lab.org
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
description: Adds color to your MiniTest output
|
63
|
+
email:
|
64
|
+
- mike@blowmage.com
|
33
65
|
executables: []
|
34
|
-
|
35
66
|
extensions: []
|
36
|
-
|
37
|
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
files:
|
41
|
-
-
|
67
|
+
extra_rdoc_files:
|
68
|
+
- CHANGELOG.rdoc
|
69
|
+
- Manifest.txt
|
70
|
+
- README.rdoc
|
71
|
+
files:
|
72
|
+
- .autotest
|
73
|
+
- CHANGELOG.rdoc
|
74
|
+
- LICENSE
|
75
|
+
- Manifest.txt
|
76
|
+
- README.rdoc
|
42
77
|
- Rakefile
|
43
|
-
-
|
44
|
-
- gem.yml
|
45
|
-
- lib/minitest-rg.rb
|
78
|
+
- lib/minitest/rg.rb
|
46
79
|
- minitest-rg.gemspec
|
47
|
-
-
|
48
|
-
-
|
49
|
-
|
50
|
-
homepage: http://github.com/pboy/minitest-rg
|
80
|
+
- test/test_minitest-rg.rb
|
81
|
+
- .gemtest
|
82
|
+
homepage: http://blowmage.com/minitest-rg
|
51
83
|
licenses: []
|
52
|
-
|
53
84
|
post_install_message:
|
54
|
-
rdoc_options:
|
55
|
-
- --
|
56
|
-
-
|
57
|
-
|
58
|
-
- Minitest-rg
|
59
|
-
require_paths:
|
85
|
+
rdoc_options:
|
86
|
+
- --main
|
87
|
+
- README.rdoc
|
88
|
+
require_paths:
|
60
89
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
- 1
|
74
|
-
- 2
|
75
|
-
version: "1.2"
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
76
102
|
requirements: []
|
77
|
-
|
78
103
|
rubyforge_project: minitest-rg
|
79
|
-
rubygems_version: 1.
|
104
|
+
rubygems_version: 1.8.24
|
80
105
|
signing_key:
|
81
106
|
specification_version: 3
|
82
|
-
summary:
|
83
|
-
test_files:
|
84
|
-
|
107
|
+
summary: RedGreen for MiniTest
|
108
|
+
test_files:
|
109
|
+
- test/test_minitest-rg.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.4
|
data/gem.yml
DELETED
data/lib/minitest-rg.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require "minitest/unit"
|
2
|
-
|
3
|
-
#
|
4
|
-
# taken from redgreen and adjusted
|
5
|
-
module MiniTest::Colors
|
6
|
-
COLORS = {
|
7
|
-
:clear => 0, :red => 31, :green => 32, :yellow => 33
|
8
|
-
}
|
9
|
-
|
10
|
-
def self.[](color_name)
|
11
|
-
"\e[#{COLORS[color_name.to_sym]}m"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module MiniTest
|
16
|
-
TEST_COLORS = {
|
17
|
-
"F" => :red,
|
18
|
-
"E" => :red,
|
19
|
-
"S" => :yellow,
|
20
|
-
"." => :green
|
21
|
-
}
|
22
|
-
|
23
|
-
def self.colored(status, msg)
|
24
|
-
color_name = TEST_COLORS[status[0,1]]
|
25
|
-
return msg if !color_name
|
26
|
-
MiniTest::Colors[color_name] + msg + MiniTest::Colors[:clear]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class MiniTest::Unit::TestCase
|
31
|
-
alias :original_run :run
|
32
|
-
|
33
|
-
def run(runner)
|
34
|
-
r = original_run(runner)
|
35
|
-
MiniTest.colored(r, r)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class MiniTest::Unit
|
40
|
-
alias :original_puke :puke
|
41
|
-
|
42
|
-
def puke(klass, meth, e)
|
43
|
-
r = original_puke(klass, meth, e)
|
44
|
-
report = @report.pop
|
45
|
-
lines = report.split(/\n/)
|
46
|
-
lines[0] = MiniTest.colored(r, lines[0])
|
47
|
-
@report << lines.join("\n")
|
48
|
-
r
|
49
|
-
end
|
50
|
-
end
|
data/tasks/echoe.rake
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# GEM settings
|
3
|
-
#
|
4
|
-
GEM_ROOT = File.expand_path("#{File.dirname(__FILE__)}/..")
|
5
|
-
if gem_config = YAML.load(File.read("#{GEM_ROOT}/gem.yml"))["gem"]
|
6
|
-
require 'echoe'
|
7
|
-
|
8
|
-
GEM_NAME = File.basename(GEM_ROOT)
|
9
|
-
Echoe.new(File.basename(GEM_ROOT), File.read("#{GEM_ROOT}/VERSION")) do |p|
|
10
|
-
gem_config.each do |k,v|
|
11
|
-
p.send "#{k}=",v
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Rebuild and install the gem"
|
16
|
-
task :rebuild => %w(manifest default build_gemspec package) do
|
17
|
-
gem = Dir.glob("pkg/*.gem").sort_by do |filename|
|
18
|
-
File.new(filename).mtime
|
19
|
-
end.last
|
20
|
-
|
21
|
-
puts "============================================="
|
22
|
-
puts "Installing gem..."
|
23
|
-
|
24
|
-
system "gem install #{gem} > /dev/null 2>&1"
|
25
|
-
|
26
|
-
puts ""
|
27
|
-
puts "I built and installed the gem for you. To upload, run "
|
28
|
-
puts
|
29
|
-
puts " gem push #{gem}"
|
30
|
-
end
|
31
|
-
end
|
data/test/test.rb
DELETED