maxitest 7.0.0 → 7.1.0
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/CHANGELOG.md +9 -0
- data/lib/maxitest/autorun.rb +1 -1
- data/lib/maxitest/vendor/around.rb +2 -3
- data/lib/maxitest/vendor/rg.rb +30 -21
- data/lib/maxitest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c2eef800a48b3d81861b0dd70a1a47da701580d3a338f38a9a0eb0edcc7806b
|
|
4
|
+
data.tar.gz: 0bb931fd5be6895ab00bdd3b0ed781657c55bcb2740aab4a6a13f861c05851eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a2fb83c159e59452ff15575028857a3fefd118cdc3ebba07e19cc6113105989b35b6a6db3e6b37b24f909ccb69d043c5842d45f49782b775c1e6cf27db0c439
|
|
7
|
+
data.tar.gz: 638ce021b65253e0670fb29078d75bb588b5f451ba66b6a03b3e6ce6006a1d7d0a51aba78f01876cc9b1bcd00ccd60913dfa46a567274389f5d7cb01072bff32
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Next
|
|
2
2
|
|
|
3
|
+
# v7.0.0
|
|
4
|
+
- only support minitest 6 (which does not work with any released rails version)
|
|
5
|
+
- removed `mtest` binary, use `minitest` instead
|
|
6
|
+
- stoped using alias method chaining, so things might break if you have other minitest extensions
|
|
7
|
+
- use frozen strings everywhere
|
|
8
|
+
|
|
9
|
+
# v6.1.0
|
|
10
|
+
- test with minitest 5.26 and 5.27
|
|
11
|
+
|
|
3
12
|
# v6.0.1
|
|
4
13
|
- fix unused block warning for `xit` on ruby 3.4
|
|
5
14
|
|
data/lib/maxitest/autorun.rb
CHANGED
|
@@ -16,7 +16,7 @@ require "maxitest/shorted_backtrace"
|
|
|
16
16
|
unless Gem::Specification.find_all_by_name("rails").any? # rails adds default red/green output
|
|
17
17
|
require "maxitest/vendor/rg"
|
|
18
18
|
Minitest.extensions << "rg"
|
|
19
|
-
Minitest::RG.rg! $stdout.tty?
|
|
19
|
+
Minitest::RG.rg! if $stdout.tty?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
require "maxitest/verbose_backtrace"
|
|
@@ -30,13 +30,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
30
30
|
# BEGIN generated by rake update, do not modify
|
|
31
31
|
# https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/version.rb
|
|
32
32
|
module MinitestAround
|
|
33
|
-
VERSION = '0.
|
|
33
|
+
VERSION = '0.6.0'
|
|
34
34
|
end
|
|
35
35
|
# END generated by rake update, do not modify
|
|
36
36
|
|
|
37
37
|
# BEGIN generated by rake update, do not modify
|
|
38
38
|
# https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/unit.rb
|
|
39
|
-
# Modified for MT6 compatibility using prepend instead of alias_method
|
|
40
39
|
Minitest::Test.prepend(Module.new do
|
|
41
40
|
def run(*args)
|
|
42
41
|
if defined?(around)
|
|
@@ -57,7 +56,7 @@ Minitest::Spec::DSL.class_eval do
|
|
|
57
56
|
# - execute test
|
|
58
57
|
# - resume fiber to execute last part
|
|
59
58
|
def around(*args, &block)
|
|
60
|
-
raise ArgumentError, "only :each or no argument
|
|
59
|
+
raise ArgumentError, "only :each, :example, or no argument are supported" if args - [:each, :example] != []
|
|
61
60
|
fib = nil
|
|
62
61
|
before do
|
|
63
62
|
fib = Fiber.new do |context, resume|
|
data/lib/maxitest/vendor/rg.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# BEGIN generated by rake update, do not modify
|
|
2
2
|
# https://raw.githubusercontent.com/blowmage/minitest-rg/master/LICENSE
|
|
3
3
|
=begin
|
|
4
|
-
Copyright (c)
|
|
4
|
+
Copyright (c) 2023 Mike Moore
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
7
|
a copy of this software and associated documentation files (the
|
|
@@ -26,25 +26,26 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
26
26
|
|
|
27
27
|
# BEGIN generated by rake update, do not modify
|
|
28
28
|
# https://raw.githubusercontent.com/blowmage/minitest-rg/master/lib/minitest/rg_plugin.rb
|
|
29
|
+
# frozen_string_literal: true
|
|
30
|
+
|
|
31
|
+
|
|
29
32
|
module Minitest
|
|
30
33
|
def self.plugin_rg_options opts, _options # :nodoc:
|
|
31
34
|
opts.on "--[no-]rg", "Add red/green to test output." do |bool|
|
|
32
|
-
RG.rg! bool
|
|
35
|
+
RG.rg! color: bool
|
|
33
36
|
end
|
|
34
37
|
end
|
|
35
38
|
|
|
36
39
|
def self.plugin_rg_init options # :nodoc:
|
|
37
|
-
|
|
38
|
-
io = RG.new options[:io]
|
|
40
|
+
return unless RG.rg?
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
end
|
|
42
|
+
io = RG.new options[:io]
|
|
43
|
+
|
|
44
|
+
reporter.reporters.grep(Minitest::Reporter).each { |rep| rep.io = io }
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
class RG
|
|
47
|
-
VERSION = "5.
|
|
48
|
+
VERSION = "5.4.0"
|
|
48
49
|
|
|
49
50
|
COLORS = {
|
|
50
51
|
"." => "\e[32m.\e[0m",
|
|
@@ -55,8 +56,8 @@ module Minitest
|
|
|
55
56
|
|
|
56
57
|
attr_reader :io, :colors
|
|
57
58
|
|
|
58
|
-
def self.rg!
|
|
59
|
-
@rg =
|
|
59
|
+
def self.rg! color: true
|
|
60
|
+
@rg = color
|
|
60
61
|
end
|
|
61
62
|
|
|
62
63
|
def self.rg?
|
|
@@ -68,26 +69,34 @@ module Minitest
|
|
|
68
69
|
@colors = colors
|
|
69
70
|
end
|
|
70
71
|
|
|
71
|
-
def print
|
|
72
|
-
io.print(colors[
|
|
72
|
+
def print output
|
|
73
|
+
io.print(colors[output] || output)
|
|
73
74
|
end
|
|
74
75
|
|
|
75
|
-
def puts
|
|
76
|
-
return io.puts if
|
|
77
|
-
|
|
76
|
+
def puts output = nil
|
|
77
|
+
return io.puts if output.nil?
|
|
78
|
+
|
|
79
|
+
if output =~ /(\d+) failures, (\d+) errors/
|
|
78
80
|
if Regexp.last_match[1] != "0" || Regexp.last_match[2] != "0"
|
|
79
|
-
io.puts "\e[31m#{
|
|
81
|
+
io.puts "\e[31m#{output}\e[0m"
|
|
80
82
|
else
|
|
81
|
-
io.puts "\e[32m#{
|
|
83
|
+
io.puts "\e[32m#{output}\e[0m"
|
|
82
84
|
end
|
|
83
85
|
else
|
|
84
|
-
io.puts
|
|
86
|
+
io.puts output
|
|
85
87
|
end
|
|
86
88
|
end
|
|
87
89
|
|
|
88
90
|
def method_missing msg, *args
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
+
return io.send(msg, *args) if io.respond_to? msg
|
|
92
|
+
|
|
93
|
+
super
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def respond_to_missing? method_name, include_all = false
|
|
97
|
+
return true if io.respond_to? method_name, include_all
|
|
98
|
+
|
|
99
|
+
super
|
|
91
100
|
end
|
|
92
101
|
end
|
|
93
102
|
end
|
data/lib/maxitest/version.rb
CHANGED