pretty_test 1.0.1 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/minitest/pretty_test_plugin.rb +10 -0
- data/lib/pretty_test/reporter.rb +9 -12
- data/pretty_test.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93c3601983d39315c1622b4ed4db949e5506b0a2
|
4
|
+
data.tar.gz: 5bbc3ba506ed9a3a647fe1f4913236e28e3f91ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a815eddf8c4e4a12d29b6ee58af2ef2226f6d532210cc53f28f4e79236134aad16ef36119a5370c5c9a2ec7f9e14a4e816a99953042b562cc1ade899b711d6b2
|
7
|
+
data.tar.gz: 272768a3b4b19ba490e39d06087a90dd4169f4a8a8ecce2e7abd838c5754aaced1ba997228c7f5cc5c8e7e61240cc48426ca54cbdcce99dbea03d459216126de
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Minitest
|
2
|
+
|
3
|
+
def self.plugin_pretty_test_init(options)
|
4
|
+
return unless STDOUT.tty?
|
5
|
+
reporter.reporters.delete_if do |r|
|
6
|
+
Minitest::ProgressReporter === r || Minitest::SummaryReporter === r
|
7
|
+
end
|
8
|
+
reporter << PrettyTest::Reporter.new(options)
|
9
|
+
end
|
10
|
+
end
|
data/lib/pretty_test/reporter.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
require "minitest"
|
2
2
|
|
3
|
-
module
|
3
|
+
module PrettyTest
|
4
4
|
|
5
|
-
class
|
5
|
+
class Reporter < ::Minitest::AbstractReporter
|
6
6
|
|
7
7
|
SKIP_FORMAT = "\e[33m[SKIPPED] %s\e[0m\n%s\n%s"
|
8
8
|
FAILURE_FORMAT = "\e[31m[FAILURE] %s\e[0m\n\e[31m%s: %s\e[0m\n%s"
|
9
9
|
ERROR_FORMAT = "\e[31m[ERROR] %s\e[0m\n\e[31m%s: %s\e[0m\n%s"
|
10
10
|
STATUS_FORMAT = "\e[2K\r\e[?7l\e[37m(%.1fs) \e[32m%d/%d tests (%d%%)\e[37m, \e[36m%d assertions\e[37m, \e[31m%d errors\e[37m, \e[31m%d failures\e[37m, \e[33m%d skips\e[?7h\e[0m"
|
11
11
|
|
12
|
-
attr_accessor :started_at, :tests, :assertions, :completed, :failures, :errors, :skips
|
12
|
+
attr_accessor :io, :started_at, :tests, :assertions, :completed, :failures, :errors, :skips
|
13
13
|
|
14
|
-
def initialize(
|
15
|
-
super
|
14
|
+
def initialize(options = {})
|
15
|
+
super()
|
16
|
+
|
17
|
+
self.io = options[:io] || $stdout
|
16
18
|
|
17
19
|
self.started_at = nil
|
18
20
|
self.completed = 0
|
@@ -50,9 +52,9 @@ module Minitest
|
|
50
52
|
update_status
|
51
53
|
end
|
52
54
|
if errors + failures == 0
|
53
|
-
io.puts "
|
55
|
+
io.puts "\n\n\e[32m----- PASSED! -----\e[0m\n\n"
|
54
56
|
else
|
55
|
-
io.puts "
|
57
|
+
io.puts "\n\n\e[31m----- FAILED! -----\e[0m\n\n"
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
@@ -132,9 +134,4 @@ module Minitest
|
|
132
134
|
io.print "\e[2K\r"
|
133
135
|
end
|
134
136
|
end
|
135
|
-
|
136
|
-
class SummaryReporter
|
137
|
-
def report
|
138
|
-
end
|
139
|
-
end
|
140
137
|
end
|
data/pretty_test.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
12
|
gem.name = "pretty_test"
|
13
13
|
gem.require_paths = ["lib"]
|
14
|
-
gem.version = "1.0.
|
14
|
+
gem.version = "1.0.2"
|
15
15
|
|
16
16
|
gem.add_dependency "minitest", "~> 5"
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Bobes Tuzinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- ".gitignore"
|
35
35
|
- Gemfile
|
36
36
|
- README.md
|
37
|
+
- lib/minitest/pretty_test_plugin.rb
|
37
38
|
- lib/pretty_test.rb
|
38
39
|
- lib/pretty_test/reporter.rb
|
39
40
|
- pretty_test.gemspec
|