color_pound_spec_reporter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/color_pound_spec_reporter.gemspec +2 -2
- data/example/color-output.png +0 -0
- data/lib/color_pound_spec_reporter/version.rb +1 -1
- data/lib/color_pound_spec_reporter.rb +13 -11
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ce1861659a57c3d9b440866fbf3fc94faaab840
|
4
|
+
data.tar.gz: 6af1643d1a9ba070f41a670c56e069761ac17e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d15cd855839f4992a316cad4366530efef83d902349898c6e0f8eb992e946389b8672824574d43addf163e5ffee8f55c730cd46507bceebf85a7e92e53448ef
|
7
|
+
data.tar.gz: 422efab60d26be81625585b21548126f9756a693e68043d1cfc4a1763cf11ab5d6791ccd08f07b14ff167015e9d2a2ea17a31e6878f1a4a514edc2666da9732f
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# ColorPoundSpecReporter
|
2
2
|
|
3
|
+
![](https://github.com/danielpclark/color_pound_spec_reporter/blob/master/example/color-output.png)
|
4
|
+
|
5
|
+
This reporter will work with minitest-reporters as far back as 0.14.24 for compatibility with testing older Rails versions. Also works with current minitest-reporters version 1+.
|
3
6
|
|
4
7
|
## Installation
|
5
8
|
|
@@ -28,7 +31,7 @@ Minitest::Reporters.use! [ColorPoundSpecReporter.new]
|
|
28
31
|
|
29
32
|
## Contributing
|
30
33
|
|
31
|
-
1. Fork it ( https://github.com/
|
34
|
+
1. Fork it ( https://github.com/danielpclark/color_pound_spec_reporter/fork )
|
32
35
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
36
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
37
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
spec.add_development_dependency "bundler", "~> 1.8"
|
20
20
|
spec.add_development_dependency "rake", "~> 10.0"
|
21
|
-
spec.add_development_dependency "minitest"
|
22
|
-
spec.add_development_dependency "minitest-reporters", "
|
21
|
+
spec.add_development_dependency "minitest", "~> 4.7.5"
|
22
|
+
spec.add_development_dependency "minitest-reporters", "~> 0.14.24"
|
23
23
|
end
|
data/example/color-output.png
CHANGED
Binary file
|
@@ -13,37 +13,38 @@ class ColorPoundSpecReporter < Minitest::Reporters::SpecReporter
|
|
13
13
|
|
14
14
|
def failure(suite, test, test_runner)
|
15
15
|
common_print(suite, test, :red, 'FAIL')
|
16
|
-
print_exception(test_runner.exception)
|
16
|
+
print_exception(test_runner.exception, 'FAIL')
|
17
17
|
end
|
18
18
|
|
19
19
|
def error(suite, test, test_runner)
|
20
20
|
common_print(suite, test, :red, 'ERROR')
|
21
|
-
print_exception(test_runner.exception)
|
21
|
+
print_exception(test_runner.exception, 'ERROR')
|
22
22
|
end
|
23
23
|
|
24
24
|
# Just in case we load a more recent minitest-reporters v1
|
25
25
|
def record(test)
|
26
26
|
Minitest::Reporters::BaseReporter.instance_method(:record).bind(self).call(test)
|
27
|
-
print pad_test(test.name) if test.failure
|
28
27
|
print_colored_status(test)
|
29
28
|
print(" (%.2fs)" % test.time)
|
30
|
-
print " :: #{color_pound test.name}"
|
31
|
-
|
32
|
-
|
29
|
+
print " :: #{color_pound test.name}"
|
30
|
+
if !test.skipped? && test.failure
|
31
|
+
print_exception(test.failure, test.error? ? 'ERROR' : '' )
|
32
|
+
else
|
33
|
+
puts
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
private
|
36
38
|
def common_print(suite, test, color, message)
|
37
39
|
print_suite(suite) unless @suites.include?(suite)
|
38
|
-
print pad_test(test) if color.eql?(:red)
|
39
40
|
print( send(color) { pad_mark(message) } )
|
40
41
|
print_time(test)
|
41
|
-
print " :: #{color_pound test}"
|
42
|
+
print " :: #{color_pound test}"
|
42
43
|
puts
|
43
44
|
end
|
44
45
|
|
45
|
-
def print_exception(ex)
|
46
|
-
|
46
|
+
def print_exception(ex, kind)
|
47
|
+
print color_pound "\n\n#{" " if kind.=~(/error/i)}#{ex}\n\n"
|
47
48
|
puts
|
48
49
|
end
|
49
50
|
|
@@ -51,7 +52,8 @@ class ColorPoundSpecReporter < Minitest::Reporters::SpecReporter
|
|
51
52
|
str.to_s.gsub(/(?<foo>(?<!:)(?:#|:)\w{1,}\??)/, ANSI::Code.yellow('\k<foo>')).
|
52
53
|
gsub(/(?<foo>[A-Z]\S*)/, ANSI::Code.cyan('\k<foo>')).
|
53
54
|
gsub(/(?<foo>(?:NIL|NULL|ERROR|FAIL|EXCEPTION|FALSE))/i, ANSI::Code.red('\k<foo>')).
|
54
|
-
gsub(/(?<foo>(?:self|true))/, ANSI::Code.green('\k<foo>'))
|
55
|
+
gsub(/(?<foo>(?:self|true))/, ANSI::Code.green('\k<foo>')).
|
56
|
+
gsub(/(?<foo>(?:Expected|Actual):)/, ANSI::Code.bold(ANSI::Code.white('\k<foo>')))
|
55
57
|
end
|
56
58
|
|
57
59
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: color_pound_spec_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel P. Clark
|
@@ -42,28 +42,28 @@ dependencies:
|
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 4.7.5
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 4.7.5
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest-reporters
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.14.24
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.14.24
|
69
69
|
description: SpecReporter with easy to follow colors.
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.4.
|
109
|
+
rubygems_version: 2.4.5
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Modifies your SpecReporter for easy to follow colored output.
|