minitest-hooks 1.5.3 → 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: 373843f53e329c5f7d3678b58f46179d4206620dbf71060b53c844fcc286d9ae
4
- data.tar.gz: f122d6fc10bde3c4bed3b7712c46214d6a24a5d69bebc508fc86962bb3006cdd
3
+ metadata.gz: de67ef1273481e697cf1454659ff256483dfcf0cf55859fc912cc759a29a743d
4
+ data.tar.gz: 7cd16abd0af796f935b7e1032959df7252087ecab02b351f9a31d747c1909b5b
5
5
  SHA512:
6
- metadata.gz: dd8e13d13357dad8b7908c92e5e8e4abf2eb878afee9759ebdd0cd49a48ebc1b023fc84a55d7caca03a8dd9670ee5ebfaef9e98c2b79c4925e701ea08ef82701
7
- data.tar.gz: 4eccd8d59563adb207675a9d35c56ff13abfa5882e5b037372b2b6d2b8c595610cfa96bb29a5540c46a9c339301b8f71d5fabdb8ffa2e324d8f934d259e632e7
6
+ metadata.gz: '0677916e0f1ed89d1a2b4096b8c2a355e4330826a3e31bef6c36a94402ee6f9e2d6da1c05fba7c3e0d7e245032dbc3042c06c33b02d2213af269d2d8cfc70bf8'
7
+ data.tar.gz: b2309c5fa6cca75f479b2b6857f3edc1cab7641fb90c58bcc7e6361e25ba1c37c8894853a1177a8228762e86b81fa584bbd0d1fe5781eaf505db8f9aad454793
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.5.4 (2026-05-04)
2
+
3
+ * Fix reported assertion counts on minitest 6+ (jeremyevans)
4
+
1
5
  === 1.5.3 (2025-12-18)
2
6
 
3
7
  * Work correctly on minitest 6+ (jeremyevans)
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,10 +49,37 @@ 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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.6.9
130
+ rubygems_version: 4.0.3
131
131
  specification_version: 4
132
132
  summary: Around and before_all/after_all/around_all hooks for Minitest
133
133
  test_files: []