minitest-hooks 1.5.2 → 1.5.4

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: 42d29c259746baab330e08c17b2a7a12f2ba1ba3fb0ebda481a38782f07b79b9
4
- data.tar.gz: 6286a96601a5d734d3db8cee4f17085b61ac68d658d3b934ef0ecf37bf24c95d
3
+ metadata.gz: de67ef1273481e697cf1454659ff256483dfcf0cf55859fc912cc759a29a743d
4
+ data.tar.gz: 7cd16abd0af796f935b7e1032959df7252087ecab02b351f9a31d747c1909b5b
5
5
  SHA512:
6
- metadata.gz: 7e4f25ff0d5c4cafbf135e479ae4755f8afc2b679b09738bc0f6a6103718b50136553b599a1c4d6e22158866834cb3665b6e426f5be7fe2531565ab8d0b30165
7
- data.tar.gz: 8c80de38937b2987d0aaa4b78923d6059b230551c1264c4427424050384afccf68e9b3b24e4344dcc72c8f5b29b495b97a4a19c3051e447b7322d4f72eae7618
6
+ metadata.gz: '0677916e0f1ed89d1a2b4096b8c2a355e4330826a3e31bef6c36a94402ee6f9e2d6da1c05fba7c3e0d7e245032dbc3042c06c33b02d2213af269d2d8cfc70bf8'
7
+ data.tar.gz: b2309c5fa6cca75f479b2b6857f3edc1cab7641fb90c58bcc7e6361e25ba1c37c8894853a1177a8228762e86b81fa584bbd0d1fe5781eaf505db8f9aad454793
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ === 1.5.4 (2026-05-04)
2
+
3
+ * Fix reported assertion counts on minitest 6+ (jeremyevans)
4
+
5
+ === 1.5.3 (2025-12-18)
6
+
7
+ * Work correctly on minitest 6+ (jeremyevans)
8
+
1
9
  === 1.5.2 (2024-08-14)
2
10
 
3
11
  * Fix use with minitest 5.25+ (paracycle) (#27, #28)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2023 Jeremy Evans
1
+ Copyright (c) 2015-2026 Jeremy Evans and contributors
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
@@ -49,15 +49,51 @@ module Minitest::Hooks::ClassMethods
49
49
  # Unless name is NEW, return a dup singleton instance.
50
50
  def new(name)
51
51
  if name.equal?(NEW)
52
- return super('around_all')
52
+ instance = super('around_all')
53
+
54
+ # Attempt to handle assertion count issues. Assertions
55
+ # are incremented on this instance (created once per test class), but
56
+ # recorded on the instance created once per test method. This forwards
57
+ # the assertion increment to the most recently created instance.
58
+ def instance.assertions
59
+ if @instance
60
+ @instance.assertions
61
+ else
62
+ super
63
+ end
64
+ end
65
+
66
+ def instance.assertions=(v)
67
+ if @instance
68
+ @instance.assertions = v
69
+ else
70
+ super
71
+ end
72
+ end
73
+
74
+ return instance
53
75
  end
54
76
 
55
77
  instance = @instance.dup
78
+ # Reset the assertions for the shared instance after it is
79
+ # copied into the current instance, so that assertions during
80
+ # before_all are counted.
81
+ @instance.instance_variable_set(:@assertions, 0)
82
+ @instance.instance_variable_set(:@instance, instance)
56
83
  instance.name = name
57
84
  instance.failures = []
58
85
  instance
59
86
  end
60
87
 
88
+ # :nocov:
89
+ if Minitest::VERSION >= '6'
90
+ # :nocov:
91
+ def run_suite(reporter, options = {})
92
+ @_minitest_hooks_reporter = reporter
93
+ super
94
+ end
95
+ end
96
+
61
97
  # When running the specs in the class, first create a singleton instance, the singleton is
62
98
  # used to implement around_all/before_all/after_all hooks, and each spec will run as a
63
99
  # dup of the singleton instance.
@@ -66,7 +102,7 @@ module Minitest::Hooks::ClassMethods
66
102
  @instance.time = 0
67
103
  @instance.name = "around_all"
68
104
 
69
- reporter = args[0]
105
+ reporter = args[0] || @_minitest_hooks_reporter # Minitest 6+
70
106
 
71
107
  begin
72
108
  @instance.around_all do
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-14 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: minitest
@@ -89,9 +88,9 @@ email: code@jeremyevans.net
89
88
  executables: []
90
89
  extensions: []
91
90
  extra_rdoc_files:
92
- - README.rdoc
93
91
  - CHANGELOG
94
92
  - MIT-LICENSE
93
+ - README.rdoc
95
94
  files:
96
95
  - CHANGELOG
97
96
  - MIT-LICENSE
@@ -102,8 +101,11 @@ files:
102
101
  homepage: http://github.com/jeremyevans/minitest-hooks
103
102
  licenses:
104
103
  - MIT
105
- metadata: {}
106
- post_install_message:
104
+ metadata:
105
+ bug_tracker_uri: https://github.com/jeremyevans/minitest-hooks/issues
106
+ changelog_uri: https://github.com/jeremyevans/minitest-hooks/blob/master/CHANGELOG
107
+ mailing_list_uri: https://github.com/jeremyevans/minitest-hooks/discussions
108
+ source_code_uri: https://github.com/jeremyevans/minitest-hooks
107
109
  rdoc_options:
108
110
  - "--quiet"
109
111
  - "--line-numbers"
@@ -118,15 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
120
  requirements:
119
121
  - - ">="
120
122
  - !ruby/object:Gem::Version
121
- version: '0'
123
+ version: '1.8'
122
124
  required_rubygems_version: !ruby/object:Gem::Requirement
123
125
  requirements:
124
126
  - - ">="
125
127
  - !ruby/object:Gem::Version
126
128
  version: '0'
127
129
  requirements: []
128
- rubygems_version: 3.5.11
129
- signing_key:
130
+ rubygems_version: 4.0.3
130
131
  specification_version: 4
131
132
  summary: Around and before_all/after_all/around_all hooks for Minitest
132
133
  test_files: []