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 ADDED
@@ -0,0 +1,8 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ Autotest.add_hook :initialize do |at|
6
+ at.testlib = 'minitest/autorun'
7
+ at.find_directories = ARGV unless ARGV.empty?
8
+ end
File without changes
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ === 1.0.0 / 2012-07-28
2
+
3
+ New release! Thanks to previous maintainer Enrico Thierbach for allowing the project to continue without him.
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
@@ -0,0 +1,9 @@
1
+ .autotest
2
+ CHANGELOG.rdoc
3
+ LICENSE
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ lib/minitest/rg.rb
8
+ minitest-rg.gemspec
9
+ test/test_minitest-rg.rb
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
- task :default => :test
1
+ # -*- ruby -*-
2
2
 
3
- task :test do
4
- sh "ruby test/test.rb"
5
- end
3
+ require 'rubygems'
4
+ require 'hoe'
6
5
 
7
- task :rcov do
8
- sh "cd test; rcov -o ../coverage -x ruby/.*/gems -x ^test.rb test.rb"
9
- end
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
- task :rdoc do
12
- sh "rdoc -o doc/rdoc"
18
+ self.readme_file = 'README.rdoc'
19
+ self.history_file = 'CHANGELOG.rdoc'
13
20
  end
14
21
 
15
- Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext|
16
- puts ext
17
- load ext }
22
+ # vim: syntax=ruby
@@ -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 = %q{minitest-rg}
5
- s.version = "0.4"
4
+ s.name = "minitest-rg"
5
+ s.version = "1.0.0.20120728083442"
6
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", "minitest-rg.gemspec", "tasks/echoe.rake", "test/test.rb"]
14
- s.homepage = %q{http://github.com/pboy/minitest-rg}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Minitest-rg"]
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 = %q{minitest-rg}
18
- s.rubygems_version = %q{1.3.6}
19
- s.summary = %q{redgreen minitest}
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::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<minitest>, [">= 0"])
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>, [">= 0"])
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>, [">= 0"])
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
- prerelease: false
5
- segments:
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
- - pboy
7
+ authors:
8
+ - Mike Moore
12
9
  autorequire:
13
10
  bindir: bin
14
11
  cert_chain: []
15
-
16
- date: 2010-05-23 00:00:00 +02:00
17
- default_executable:
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
- requirement: &id001 !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- segments:
27
- - 0
28
- version: "0"
29
- type: :runtime
30
- version_requirements: *id001
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
- extra_rdoc_files:
38
- - lib/minitest-rg.rb
39
- - tasks/echoe.rake
40
- files:
41
- - Manifest
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
- - VERSION
44
- - gem.yml
45
- - lib/minitest-rg.rb
78
+ - lib/minitest/rg.rb
46
79
  - minitest-rg.gemspec
47
- - tasks/echoe.rake
48
- - test/test.rb
49
- has_rdoc: true
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
- - --line-numbers
56
- - --inline-source
57
- - --title
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
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- segments:
66
- - 0
67
- version: "0"
68
- required_rubygems_version: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- segments:
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.3.6
104
+ rubygems_version: 1.8.24
80
105
  signing_key:
81
106
  specification_version: 3
82
- summary: redgreen minitest
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
@@ -1,10 +0,0 @@
1
- gem:
2
- description: redgreen minitest
3
- url: http://github.com/pboy/minitest-rg
4
- author: pboy
5
- email: eno-pboy@open-lab.org
6
- ignore_pattern:
7
- - "tmp/*"
8
- - "**/.*"
9
- runtime_dependencies:
10
- - minitest
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
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env ruby
2
- puts "Test dummy"