maxitest 7.0.0 → 7.1.1
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 +15 -0
- data/lib/maxitest/autorun.rb +5 -1
- data/lib/maxitest/shorted_backtrace.rb +2 -0
- data/lib/maxitest/vendor/around.rb +2 -3
- data/lib/maxitest/vendor/rg.rb +30 -21
- data/lib/maxitest/version.rb +1 -1
- metadata +2 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e5f08e76db7788953ad7277f33134b6687619c06a4e239c32862cd66421248d
|
|
4
|
+
data.tar.gz: 57d99db63d759537e979bac283227065bffbb4c89dbb37d38fb4ebfbadc94a56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91041a1409c08da9d2dccc7501f7c3e1168607eee32078ade9747d8cefe3593d8f4c30b325a968c7ac2575aafbd0ed598fe56416ed26d3a78ed36f475a8d8efb
|
|
7
|
+
data.tar.gz: db1a2b4fec18740e28946190e3b6a8a4c9298045283d930654e795d67f7830fb2c304d136c1ba2fc521f87f1b190322c9bee387dd887aebcb9ebb0f6b1e8823e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Next
|
|
2
2
|
|
|
3
|
+
# v7.1.0
|
|
4
|
+
- update vendored gems
|
|
5
|
+
|
|
6
|
+
# v7.0.0
|
|
7
|
+
- only support minitest 6 (which does not work with any released rails version)
|
|
8
|
+
- removed `mtest` binary, use `minitest` instead
|
|
9
|
+
- stoped using alias method chaining, so things might break if you have other minitest extensions
|
|
10
|
+
- use frozen strings everywhere
|
|
11
|
+
|
|
12
|
+
# v6.2.0
|
|
13
|
+
- test and unblock ruby 4
|
|
14
|
+
|
|
15
|
+
# v6.1.0
|
|
16
|
+
- test with minitest 5.26 and 5.27
|
|
17
|
+
|
|
3
18
|
# v6.0.1
|
|
4
19
|
- fix unused block warning for `xit` on ruby 3.4
|
|
5
20
|
|
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"
|
|
@@ -35,3 +35,7 @@ end
|
|
|
35
35
|
old = Minitest::BacktraceFilter::MT_RE
|
|
36
36
|
Minitest::BacktraceFilter.send(:remove_const, :MT_RE)
|
|
37
37
|
Minitest::BacktraceFilter::MT_RE = Regexp.union(old, %r{lib/maxitest})
|
|
38
|
+
# if already initialized the override
|
|
39
|
+
if Minitest.backtrace_filter.class == Minitest::BacktraceFilter
|
|
40
|
+
Minitest.backtrace_filter.regexp = Minitest::BacktraceFilter::MT_RE
|
|
41
|
+
end
|
|
@@ -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
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maxitest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Grosser
|
|
@@ -96,16 +96,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
- - ">="
|
|
97
97
|
- !ruby/object:Gem::Version
|
|
98
98
|
version: '3.2'
|
|
99
|
-
- - "<"
|
|
100
|
-
- !ruby/object:Gem::Version
|
|
101
|
-
version: '4.1'
|
|
102
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
100
|
requirements:
|
|
104
101
|
- - ">="
|
|
105
102
|
- !ruby/object:Gem::Version
|
|
106
103
|
version: '0'
|
|
107
104
|
requirements: []
|
|
108
|
-
rubygems_version:
|
|
105
|
+
rubygems_version: 4.0.3
|
|
109
106
|
specification_version: 4
|
|
110
107
|
summary: Minitest + all the features you always wanted
|
|
111
108
|
test_files: []
|