minitest-ansi 0.1.1 → 0.1.2
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.
- data/README.md +36 -7
- data/lib/minitest/ansi/version.rb +1 -1
- metadata +10 -30
- data/spec/lib/minitest/ansi_spec.rb +0 -97
- data/spec/spec_helper.rb +0 -2
data/README.md
CHANGED
@@ -1,27 +1,48 @@
|
|
1
1
|
# MiniTest::ANSI
|
2
2
|
|
3
|
+
[![Build Status][travis-badge]][travis-site]
|
4
|
+
[![Dependency Status][gemnasium-badge]][gemnasium-site]
|
5
|
+
[![Code Climate][cc-badge]][cc-site]
|
6
|
+
|
3
7
|
Colorize your minitest output using ANSI colors.
|
4
8
|
|
5
|
-
|
9
|
+
Tested under MRI 1.8, 1.9 and 2.0, JRuby and Rubinius.
|
10
|
+
|
11
|
+
## How it looks
|
12
|
+
|
13
|
+
![Screenshot][screenshot]
|
6
14
|
|
7
15
|
## Installation
|
8
16
|
|
9
17
|
Add this line to your application's Gemfile:
|
10
18
|
|
11
|
-
|
19
|
+
```ruby
|
20
|
+
group :test do
|
21
|
+
gem 'minitest-ansi'
|
22
|
+
end
|
23
|
+
```
|
12
24
|
|
13
25
|
And then execute:
|
14
26
|
|
15
|
-
|
27
|
+
```bash
|
28
|
+
$ bundle
|
29
|
+
```
|
16
30
|
|
17
|
-
Or install it yourself
|
31
|
+
Or install it yourself:
|
18
32
|
|
19
|
-
|
33
|
+
```bash
|
34
|
+
$ gem install minitest-ansi
|
35
|
+
```
|
20
36
|
|
21
37
|
## Usage
|
22
38
|
|
23
|
-
|
24
|
-
|
39
|
+
You probably want to add this to your `test_helper.rb` (or equivalent).
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'minitest/ansi'
|
43
|
+
|
44
|
+
MiniTest::ANSI.use!
|
45
|
+
```
|
25
46
|
|
26
47
|
## Contributing
|
27
48
|
|
@@ -30,3 +51,11 @@ Or install it yourself as:
|
|
30
51
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
52
|
4. Push to the branch (`git push origin my-new-feature`)
|
32
53
|
5. Create new Pull Request
|
54
|
+
|
55
|
+
[cc-badge]: https://codeclimate.com/badge.png
|
56
|
+
[cc-site]: https://codeclimate.com/github/rizzatti/minitest-ansi
|
57
|
+
[gemnasium-badge]: https://gemnasium.com/rizzatti/minitest-ansi.png
|
58
|
+
[gemnasium-site]: https://gemnasium.com/rizzatti/minitest-ansi
|
59
|
+
[screenshot]: https://github.com/rizzatti/minitest-ansi/raw/master/images/screenshot.png
|
60
|
+
[travis-badge]: https://travis-ci.org/rizzatti/minitest-ansi.png
|
61
|
+
[travis-site]: https://travis-ci.org/rizzatti/minitest-ansi
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-ansi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- José Otávio Rizzatti
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ansi
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: '1.3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,39 +26,23 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: '1.3'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: minitest
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '4.3'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '4.3'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rake
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
49
33
|
none: false
|
50
34
|
requirements:
|
51
35
|
- - ! '>='
|
52
36
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
54
|
-
type: :
|
37
|
+
version: '2.5'
|
38
|
+
type: :runtime
|
55
39
|
prerelease: false
|
56
40
|
version_requirements: !ruby/object:Gem::Requirement
|
57
41
|
none: false
|
58
42
|
requirements:
|
59
43
|
- - ! '>='
|
60
44
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
45
|
+
version: '2.5'
|
62
46
|
description: Colorizes minitest output with ANSI codes
|
63
47
|
email:
|
64
48
|
- zehrizzatti@gmail.com
|
@@ -68,11 +52,9 @@ extra_rdoc_files: []
|
|
68
52
|
files:
|
69
53
|
- lib/minitest/ansi/version.rb
|
70
54
|
- lib/minitest/ansi.rb
|
71
|
-
- spec/lib/minitest/ansi_spec.rb
|
72
|
-
- spec/spec_helper.rb
|
73
55
|
- README.md
|
74
56
|
- LICENSE.txt
|
75
|
-
homepage: https://github.com/
|
57
|
+
homepage: https://github.com/rizzatti/minitest-ansi
|
76
58
|
licenses: []
|
77
59
|
post_install_message:
|
78
60
|
rdoc_options: []
|
@@ -96,6 +78,4 @@ rubygems_version: 1.8.23
|
|
96
78
|
signing_key:
|
97
79
|
specification_version: 3
|
98
80
|
summary: Colors for minitest output
|
99
|
-
test_files:
|
100
|
-
- spec/lib/minitest/ansi_spec.rb
|
101
|
-
- spec/spec_helper.rb
|
81
|
+
test_files: []
|
@@ -1,97 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'minitest/ansi'
|
3
|
-
require 'stringio'
|
4
|
-
|
5
|
-
module MiniTest
|
6
|
-
describe ANSI do
|
7
|
-
before { @output = MiniTest::Unit.output }
|
8
|
-
after { MiniTest::Unit.output = @output }
|
9
|
-
|
10
|
-
subject { ANSI }
|
11
|
-
|
12
|
-
it 'has a version number' do
|
13
|
-
subject::VERSION.must_equal ANSIVersion::VERSION
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'changes minitest output with use!' do
|
17
|
-
output = subject.use!
|
18
|
-
output.object_id.must_be_same_as MiniTest::Unit.output.object_id
|
19
|
-
output.must_respond_to :print
|
20
|
-
output.must_respond_to :puts
|
21
|
-
end
|
22
|
-
|
23
|
-
describe 'IO' do
|
24
|
-
subject { ANSI.new(StringIO.new) }
|
25
|
-
|
26
|
-
def assert_io(method, input, output)
|
27
|
-
subject.public_send method, input
|
28
|
-
subject.rewind
|
29
|
-
subject.read.must_equal output
|
30
|
-
end
|
31
|
-
|
32
|
-
def assert_print(input, output)
|
33
|
-
assert_io(:print, input, output)
|
34
|
-
end
|
35
|
-
|
36
|
-
def assert_puts(input, output)
|
37
|
-
assert_io(:puts, input, output + "\n")
|
38
|
-
end
|
39
|
-
|
40
|
-
describe 'printing chars' do
|
41
|
-
it 'prints . in green' do
|
42
|
-
assert_print '.', "\e[32m.\e[0m"
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'prints F in yellow' do
|
46
|
-
assert_print 'F', "\e[33mF\e[0m"
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'prints E in red' do
|
50
|
-
assert_print 'E', "\e[31mE\e[0m"
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'prints S in cyan' do
|
54
|
-
assert_print 'S', "\e[36mS\e[0m"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe 'describing each problem' do
|
59
|
-
it 'prints failures in yellow' do
|
60
|
-
assert_puts '1) Failure', "\e[33m1) Failure\e[0m"
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'prints errors in red' do
|
64
|
-
assert_puts ' 2) Error', " \e[31m2) Error\e[0m"
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'prints skippeds in cyan' do
|
68
|
-
assert_puts '60) Skipped', "\e[36m60) Skipped\e[0m"
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe 'showing the status line' do
|
73
|
-
it 'prints failures in yellow' do
|
74
|
-
assert_puts '3 tests, 1 failures', "3 tests, \e[33m1 failures\e[0m"
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'print error in red' do
|
78
|
-
assert_puts '10 tests, 3 errors', "10 tests, \e[31m3 errors\e[0m"
|
79
|
-
end
|
80
|
-
|
81
|
-
it 'prints skips in cyan' do
|
82
|
-
assert_puts '5 tests, 2 skips', "5 tests, \e[36m2 skips\e[0m"
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'does not colorize when there are no problems' do
|
86
|
-
input = '99 tests, 0 failures, 0 errors, 0 skips'
|
87
|
-
subject.puts input
|
88
|
-
subject.rewind
|
89
|
-
output = subject.read
|
90
|
-
output.wont_match "\e[33m"
|
91
|
-
output.wont_match "\e[36m"
|
92
|
-
output.wont_match "\e[31m"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
data/spec/spec_helper.rb
DELETED