minitest-rg 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +0 -0
- data/Rakefile +17 -0
- data/VERSION +1 -0
- data/gem.yml +12 -0
- data/lib/minitest-rg.rb +50 -0
- data/minitest-rg.gemspec +30 -0
- data/tasks/echoe.rake +31 -0
- data/test/test.rb +1 -0
- metadata +73 -0
data/Manifest
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
task :default => :test
|
2
|
+
|
3
|
+
task :test do
|
4
|
+
sh "ruby test/test.rb"
|
5
|
+
end
|
6
|
+
|
7
|
+
task :rcov do
|
8
|
+
sh "cd test; rcov -o ../coverage -x ruby/.*/gems -x ^test.rb test.rb"
|
9
|
+
end
|
10
|
+
|
11
|
+
task :rdoc do
|
12
|
+
sh "rdoc -o doc/rdoc"
|
13
|
+
end
|
14
|
+
|
15
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext|
|
16
|
+
puts ext
|
17
|
+
load ext }
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2
|
data/gem.yml
ADDED
data/lib/minitest-rg.rb
ADDED
@@ -0,0 +1,50 @@
|
|
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/minitest-rg.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{minitest-rg}
|
5
|
+
s.version = "0.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["pboy"]
|
9
|
+
s.date = %q{2010-05-23}
|
10
|
+
s.description = %q{redgreen minitest}
|
11
|
+
s.email = %q{eno-pboy@open-lab.org}
|
12
|
+
s.extra_rdoc_files = ["lib/minitest-rg.rb", "tasks/echoe.rake"]
|
13
|
+
s.files = ["Manifest", "Rakefile", "VERSION", "gem.yml", "lib/minitest-rg.rb", "tasks/echoe.rake", "test/test.rb", "minitest-rg.gemspec"]
|
14
|
+
s.homepage = %q{http://github.com/pboy/minitest-rg}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Minitest-rg"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{minitest-rg}
|
18
|
+
s.rubygems_version = %q{1.3.6}
|
19
|
+
s.summary = %q{redgreen minitest}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/tasks/echoe.rake
ADDED
@@ -0,0 +1,31 @@
|
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
puts "Dummy tests..."
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-rg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
version: "0.2"
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- pboy
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
|
16
|
+
date: 2010-05-23 00:00:00 +02:00
|
17
|
+
default_executable:
|
18
|
+
dependencies: []
|
19
|
+
|
20
|
+
description: redgreen minitest
|
21
|
+
email: eno-pboy@open-lab.org
|
22
|
+
executables: []
|
23
|
+
|
24
|
+
extensions: []
|
25
|
+
|
26
|
+
extra_rdoc_files:
|
27
|
+
- lib/minitest-rg.rb
|
28
|
+
- tasks/echoe.rake
|
29
|
+
files:
|
30
|
+
- Manifest
|
31
|
+
- Rakefile
|
32
|
+
- VERSION
|
33
|
+
- gem.yml
|
34
|
+
- lib/minitest-rg.rb
|
35
|
+
- tasks/echoe.rake
|
36
|
+
- test/test.rb
|
37
|
+
- minitest-rg.gemspec
|
38
|
+
has_rdoc: true
|
39
|
+
homepage: http://github.com/pboy/minitest-rg
|
40
|
+
licenses: []
|
41
|
+
|
42
|
+
post_install_message:
|
43
|
+
rdoc_options:
|
44
|
+
- --line-numbers
|
45
|
+
- --inline-source
|
46
|
+
- --title
|
47
|
+
- Minitest-rg
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 2
|
64
|
+
version: "1.2"
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
rubyforge_project: minitest-rg
|
68
|
+
rubygems_version: 1.3.6
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: redgreen minitest
|
72
|
+
test_files: []
|
73
|
+
|