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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 982184ff34c2a4958c9e52ebc4906d861a9c18caa3af656940e0cd1d7918d2c4
4
- data.tar.gz: e282741931d6eac6b10a2bed360c7fa6fd67121e307e2450fa264ff62f5251ea
3
+ metadata.gz: 0c2eef800a48b3d81861b0dd70a1a47da701580d3a338f38a9a0eb0edcc7806b
4
+ data.tar.gz: 0bb931fd5be6895ab00bdd3b0ed781657c55bcb2740aab4a6a13f861c05851eb
5
5
  SHA512:
6
- metadata.gz: dac139633277d2b16ef1c01cd34c5ddf4948de2dacc0ed7fd5974207b89fec846ecb6e1b88595b4c8ee5e685bcdf4bb6e0e0ed1ae39e4ef1c2e8ca04fe115853
7
- data.tar.gz: 456476d7ec079121af8ef2e1c8640370494efd9bc062f59f03052e10ced0be8e1c11fec5ca7772a20f335e88c57a4a7c8d4053fff4458cbabd8bcef7b59f62bb
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
 
@@ -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.5.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 is supported" if args != [] && args != [:each]
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|
@@ -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) 2012 Mike Moore
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
- if RG.rg?
38
- io = RG.new options[:io]
40
+ return unless RG.rg?
39
41
 
40
- reporter.reporters.grep(Minitest::Reporter).each do |rep|
41
- rep.io = io
42
- end
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.2.0".freeze
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!(bool = true)
59
- @rg = bool
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 o
72
- io.print(colors[o] || o)
72
+ def print output
73
+ io.print(colors[output] || output)
73
74
  end
74
75
 
75
- def puts o = nil
76
- return io.puts if o.nil?
77
- if o =~ /(\d+) failures, (\d+) errors/
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#{o}\e[0m"
81
+ io.puts "\e[31m#{output}\e[0m"
80
82
  else
81
- io.puts "\e[32m#{o}\e[0m"
83
+ io.puts "\e[32m#{output}\e[0m"
82
84
  end
83
85
  else
84
- io.puts o
86
+ io.puts output
85
87
  end
86
88
  end
87
89
 
88
90
  def method_missing msg, *args
89
- return super unless io.respond_to? msg
90
- io.send(msg, *args)
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Maxitest
3
- VERSION = "7.0.0"
3
+ VERSION = "7.1.0"
4
4
  end
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.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser