minitest 5.26.0 → 5.26.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecf3d390663e8f655908e6feef0796c5666930f979a0010e27d5adf4956b0bfc
4
- data.tar.gz: be16818cbc164296bdacde79856532e5695bd6e45dec7d28e624e75bbccbf465
3
+ metadata.gz: 99c81ecf40f2e6edde9201cded0808484223cdf20d3e819e1b043e50bcc2564c
4
+ data.tar.gz: 543e61e5ac5da94ddbaaa51969b0b5dbf2ea91b400c13fd88830396a22627867
5
5
  SHA512:
6
- metadata.gz: 4690ff166d9757befd4365ca3ca77443e4252c32132e91933093548b179ae051cade595e1a085e373e9f6a32b4677d38073cfc1b6e386a00bf77edc8cffad487
7
- data.tar.gz: 923c90aaff33957818b8fcb053bf9fb28c01953ec910d42114cd3ba09204a0166e85824fb7188bc944f12a7855c47c0e6f63a39d2f45fcb37f25b8176416cd18
6
+ metadata.gz: 1e73adb8391043dc989b7dd2c307f5e5af72f2f2e51ef1e0fda7654cff90755fd920e2003f86ef0fa62bae2fbc9e9ec9a7a6bea76abc6a46c5b7f0500fa5b337
7
+ data.tar.gz: 3a860d654d72db62a86397b6849fa5509e21e5f5a021e920b0bca46d147cd8f5d7d5203ad28eb73b22b2a643683db0e8fa8948437688ec18642ef21666e3095f
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,14 @@
1
+ === 5.26.1 / 2025-11-08
2
+
3
+ The Ocean Shores, Slightly Less Tipsy Edition!
4
+
5
+ * 3 bug fixes:
6
+
7
+ * Add links to API doco in README.
8
+ * Add missing require thread.
9
+ * Bumped ruby version to include 4.0 (trunk). (hsbt)
10
+ (see also 5.14.2)
11
+
1
12
  === 5.26.0 / 2025-10-07
2
13
 
3
14
  The Seattle.rb Nerd Party, Slightly Tipsy Edition!
data/README.rdoc CHANGED
@@ -95,7 +95,9 @@ Given that you'd like to test the following class:
95
95
 
96
96
  === Unit tests
97
97
 
98
- Define your tests as methods beginning with +test_+.
98
+ Define your tests as methods beginning with +test_+. Use
99
+ {assertions}[/minitest/Minitest/Assertions.html] to test for results
100
+ or state.
99
101
 
100
102
  require "minitest/autorun"
101
103
 
@@ -119,6 +121,9 @@ Define your tests as methods beginning with +test_+.
119
121
 
120
122
  === Specs
121
123
 
124
+ Use {expectations}[/minitest/Minitest/Expectations.html] to check
125
+ results or state. They must be wrapped in a value call (eg +_+).
126
+
122
127
  require "minitest/autorun"
123
128
 
124
129
  describe Meme do
@@ -146,7 +151,7 @@ For matchers support check out:
146
151
 
147
152
  === Benchmarks
148
153
 
149
- Add benchmarks to your tests.
154
+ Add {benchmarks}[/minitest/Minitest/Benchmark.html] to your tests.
150
155
 
151
156
  # optionally run benchmarks, good for CI-only work!
152
157
  require "minitest/benchmark" if ENV["BENCH"]
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ Hoe.spec "minitest" do
11
11
 
12
12
  license "MIT"
13
13
 
14
- require_ruby_version [">= 2.7", "< 4.0"]
14
+ require_ruby_version ">= 2.7"
15
15
  end
16
16
 
17
17
  desc "Find missing expectations"
data/design_rationale.rb CHANGED
@@ -2,25 +2,27 @@
2
2
  ###############################################################################
3
3
  describe Thingy do # class TestThingy < Minitest::Test
4
4
  before do # def setup
5
- do_some_setup # super
6
- end # do_some_setup
7
- # end
8
- it "should do the first thing" do #
9
- 1.must_equal 1 # def test_first_thing
10
- end # assert_equal 1, 1
11
- # end
12
- describe SubThingy do # end
13
- before do #
14
- do_more_setup # class TestSubThingy < TestThingy
15
- end # def setup
16
5
  # super
17
- it "should do the second thing" do # do_more_setup
18
- 2.must_equal 2 # end
19
- end #
20
- end # def test_second_thing
21
- end # assert_equal 2, 2
22
- # end
6
+ do_some_setup # do_some_setup
7
+ end # end
8
+ #
9
+ it "should do the first thing" do # def test_first_thing
10
+ _(1).must_equal 1 # assert_equal 1, 1
11
+ end # end
23
12
  # end
13
+ #
14
+ describe SubThingy do # class TestSubThingy < TestThingy
15
+ before do # def setup
16
+ # super
17
+ do_more_setup # do_more_setup
18
+ end # end
19
+ #
20
+ it "should do the second thing" do # def test_second_thing
21
+ _(2).must_equal 2 # assert_equal 2, 2
22
+ end # end
23
+ end # end
24
+ end #
25
+ #
24
26
  ###############################################################################
25
27
  # runs 2 specs # runs 3 tests
26
28
  ###############################################################################
@@ -33,7 +35,7 @@ class ThingySpec < Minitest::Spec
33
35
  end
34
36
 
35
37
  def test_should_do_the_first_thing
36
- assert_equal 1, 1
38
+ _(1).must_equal 1
37
39
  end
38
40
  end
39
41
 
@@ -47,6 +49,6 @@ class SubThingySpec < ThingySpec
47
49
  remove_method :test_should_do_the_first_thing
48
50
 
49
51
  def test_should_do_the_second_thing
50
- assert_equal 2, 2
52
+ _(2).must_equal 2
51
53
  end
52
54
  end
@@ -1,3 +1,5 @@
1
+ require "thread"
2
+
1
3
  module Minitest
2
4
  module Parallel # :nodoc:
3
5
 
data/lib/minitest.rb CHANGED
@@ -10,7 +10,7 @@ require_relative "minitest/compress"
10
10
  # runtime. See +Minitest.run+ for more information.
11
11
 
12
12
  module Minitest
13
- VERSION = "5.26.0" # :nodoc:
13
+ VERSION = "5.26.1" # :nodoc:
14
14
 
15
15
  @@installed_at_exit ||= false
16
16
  @@after_run = []
@@ -411,6 +411,7 @@ module Minitest
411
411
  pos = Regexp.new $1 if pos.kind_of?(String) && pos =~ %r%/(.*)/%
412
412
  neg = Regexp.new $1 if neg.kind_of?(String) && neg =~ %r%/(.*)/%
413
413
 
414
+ # at most 1-2% slower than a 1-pass version, stop optimizing this
414
415
  filtered_methods = self.runnable_methods
415
416
  .select { |m| !pos || pos === m || pos === "#{self}##{m}" }
416
417
  .reject { |m| neg && (neg === m || neg === "#{self}##{m}") }
@@ -574,7 +575,7 @@ module Minitest
574
575
  def skipped?
575
576
  raise NotImplementedError, "subclass responsibility"
576
577
  end
577
- end
578
+ end # Runnable
578
579
 
579
580
  ##
580
581
  # Shared code for anything that can get passed to a Reporter. See
@@ -626,7 +627,7 @@ module Minitest
626
627
  def error?
627
628
  self.failures.any? UnexpectedError
628
629
  end
629
- end
630
+ end # Reportable
630
631
 
631
632
  ##
632
633
  # This represents a test result in a clean way that can be
@@ -680,7 +681,7 @@ module Minitest
680
681
  "#{failure.result_label}:\n#{self.location}:\n#{failure.message}\n"
681
682
  }.join "\n"
682
683
  end
683
- end
684
+ end # Result
684
685
 
685
686
  ##
686
687
  # Defines the API for Reporters. Subclass this and override whatever
@@ -730,7 +731,7 @@ module Minitest
730
731
  def synchronize &block # :nodoc:
731
732
  @mutex.synchronize(&block)
732
733
  end
733
- end
734
+ end # AbstractReportera
734
735
 
735
736
  class Reporter < AbstractReporter # :nodoc:
736
737
  ##
@@ -885,7 +886,7 @@ module Minitest
885
886
  self.warnings = aggregate[UnexpectedWarning].size
886
887
  self.skips = aggregate[Skip].size
887
888
  end
888
- end
889
+ end # StatisticsReporter
889
890
 
890
891
  ##
891
892
  # A reporter that prints the header, summary, and failure details at
@@ -963,7 +964,7 @@ module Minitest
963
964
  "%d runs, %d assertions, %d failures, %d errors, %d skips%s" %
964
965
  [count, assertions, failures, errors, skips, extra.join]
965
966
  end
966
- end
967
+ end # SummaryReporter
967
968
 
968
969
  ##
969
970
  # Dispatch to multiple reporters as one.
@@ -1014,7 +1015,7 @@ module Minitest
1014
1015
  def report # :nodoc:
1015
1016
  self.reporters.each(&:report)
1016
1017
  end
1017
- end
1018
+ end # CompositeReporter
1018
1019
 
1019
1020
  ##
1020
1021
  # Represents run failures.
@@ -108,7 +108,7 @@ describe Minitest::Spec do
108
108
  end
109
109
 
110
110
  it "needs to catch an expected exception" do
111
- @assertion_count = 2
111
+ @assertion_count -= 2
112
112
 
113
113
  expect { raise "blah" }.must_raise RuntimeError
114
114
  expect { raise Minitest::Assertion }.must_raise Minitest::Assertion
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.0
4
+ version: 5.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -176,9 +176,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '2.7'
179
- - - "<"
180
- - !ruby/object:Gem::Version
181
- version: '4.0'
182
179
  required_rubygems_version: !ruby/object:Gem::Requirement
183
180
  requirements:
184
181
  - - ">="
metadata.gz.sig CHANGED
Binary file