minitest 6.0.4 → 6.0.6

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: 2f271addaa72041211c16874b0a9b1b6597121929651243e4486ccb3316b779f
4
- data.tar.gz: '07886cf71dcd1b57ed7251ad594e9228ae8678fef9da2476d9dc74f940a6a9d1'
3
+ metadata.gz: 5bd5f764a0e5823b6af414ce7869ad229d5f417e901796475965dc869f81b0c3
4
+ data.tar.gz: b82a599afbc0ea6d9e4fe022fdf2fb20f81d875d012c57dd0db9cc7bf2a15acc
5
5
  SHA512:
6
- metadata.gz: 15e676c3eedfe71b65db0abaf77da63ba2c5a6c67b1d0f1d2855d05f9ee5df7124f558158a268d86829658f4ac60fa456f8d9150668f72e415c427724193e8e1
7
- data.tar.gz: 4db65ac06306db336c9ee7aa10b0e8869bdb9f9ce1adbf7b493838b6bc0ddd6d71c12f0a5896d7c422e25ea6115e6ea2735a4294a1bdcdfadff0f5e395690a7e
6
+ metadata.gz: da7ef69a9a580f646ec8071574af269cc3c6a31055d2fbb5eecd6b4ba332338c91ad09469f85982b6882354e67fe82845636671bc8fd2cabe85db97497391d18
7
+ data.tar.gz: 05bad64ac6aa587be47737759231213c1ae86f2d7b78837392a6efddc3e7559b7f293a9d38056ed8dbcff868d601c2c6c2fea673a185da30d50d2c5193e164f7
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- Z�>�:%�!��˻;�e��ğ����'BY�Bg�y ��7w=|)6ڨ��m��+��{��d���4sE'V]>i�2t"
2
- �� Wk��a d{����R"��*��Sg�;�"8Y��]��nvp��{Y[��(��\�r�>�K;if���?$Tt�S�歐d��O��
1
+ ��IV|HLo٭�"Um,�j��Do·���~:���a>�Fb8� Y��}ܘC��
2
+ ��)v�v|P�ݤ̉婯�S�B�r �۰�҄�o�P�#"<R[/w%������V}e�GqY�&I�ݩ��=����n�v�.�� V“kC�:B�����o�ȣ nN_zTU]�
data/History.rdoc CHANGED
@@ -1,3 +1,17 @@
1
+ === 6.0.6 / 2026-04-30
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fix using assert_equal/same/nil w/ BasicObject by comparing w/ `nil == exp`. (mtasaka)
6
+ * Removed private Assertions#_where as it is no longer used.
7
+
8
+ === 6.0.5 / 2026-04-20
9
+
10
+ * 2 bug fixes:
11
+
12
+ * Avoid circular requires in lib/minitest/server_plugin.rb.
13
+ * Raise TypeError if assert_raises is passed anything but modules/classes.
14
+
1
15
  === 6.0.4 / 2026-04-14
2
16
 
3
17
  * 1 bug fix:
@@ -190,11 +190,6 @@ module Minitest
190
190
  assert_predicate obj, :empty?, msg
191
191
  end
192
192
 
193
- def _where # :nodoc:
194
- Minitest.filter_backtrace(caller).first
195
- .split(":in ", 2).first # clean up noise
196
- end
197
-
198
193
  ##
199
194
  # Fails unless <tt>exp == act</tt> printing the difference between
200
195
  # the two, if possible.
@@ -211,7 +206,7 @@ module Minitest
211
206
  def assert_equal exp, act, msg = nil
212
207
  msg = message(msg, nil) { diff exp, act }
213
208
 
214
- refute_nil exp, message { "Use assert_nil if expecting nil" } if exp.nil? # don't count
209
+ refute_nil exp, message { "Use assert_nil if expecting nil" } if nil == exp # don't count
215
210
 
216
211
  assert exp == act, msg
217
212
  end
@@ -287,7 +282,7 @@ module Minitest
287
282
 
288
283
  def assert_nil obj, msg = nil
289
284
  msg = message(msg) { "Expected #{mu_pp obj} to be nil" }
290
- assert obj.nil?, msg
285
+ assert nil == obj, msg
291
286
  end
292
287
 
293
288
  ##
@@ -381,6 +376,8 @@ module Minitest
381
376
  assert o1.__send__(op), msg
382
377
  end
383
378
 
379
+ NO_RE_MSG = "class or module required for rescue clause. Got %p"
380
+
384
381
  ##
385
382
  # Fails unless the block raises one of +exp+. Returns the
386
383
  # exception matched so you can check the message, attributes, etc.
@@ -410,6 +407,9 @@ module Minitest
410
407
  msg = "#{exp.pop}.\n" if String === exp.last
411
408
  exp << StandardError if exp.empty?
412
409
 
410
+ # TODO: remove this if https://bugs.ruby-lang.org/issues/22007 gets fixed
411
+ raise TypeError, NO_RE_MSG % [exp] unless exp.all? Module
412
+
413
413
  begin
414
414
  yield
415
415
  rescue *exp => e
@@ -449,7 +449,7 @@ module Minitest
449
449
  "Expected %s (oid=%d) to be the same as %s (oid=%d)" % data
450
450
  }
451
451
 
452
- refute_nil exp, message { "Use assert_nil if expecting nil" } if exp.nil? # don't count
452
+ refute_nil exp, message { "Use assert_nil if expecting nil" } if nil == exp # don't count
453
453
 
454
454
  assert exp.equal?(act), msg
455
455
  end
@@ -606,7 +606,7 @@ module Minitest
606
606
  def message msg = nil, ending = ".", &default
607
607
  return msg if Proc === msg
608
608
  proc {
609
- custom_message = "#{msg}.\n" unless msg.nil? or msg.to_s.empty?
609
+ custom_message = "#{msg}.\n" unless nil == msg or msg.to_s.empty?
610
610
  "#{custom_message}#{default.call}#{ending}"
611
611
  }
612
612
  end
@@ -707,7 +707,7 @@ module Minitest
707
707
 
708
708
  def refute_nil obj, msg = nil
709
709
  msg = message(msg) { "Expected #{mu_pp obj} to not be nil" }
710
- refute obj.nil?, msg
710
+ refute nil == obj, msg
711
711
  end
712
712
 
713
713
  ##
@@ -1,4 +1,4 @@
1
- require_relative "../minitest"
1
+ require_relative "../minitest" unless defined? Minitest
2
2
 
3
3
  # :stopdoc:
4
4
 
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 = "6.0.4" # :nodoc:
13
+ VERSION = "6.0.6" # :nodoc:
14
14
 
15
15
  @@installed_at_exit ||= false
16
16
  @@after_run = []
@@ -810,6 +810,66 @@ class TestMinitestAssertions < Minitest::Test
810
810
  end
811
811
  end
812
812
 
813
+ def test_assert_raises__string_msg
814
+ e = assert_raises Minitest::Assertion do
815
+ @tc.assert_raises RuntimeError, "assertion message" do
816
+ raise SomeError, "blah"
817
+ end
818
+ end
819
+
820
+ expected = <<~EOM.chomp
821
+ assertion message.
822
+ [RuntimeError] exception expected, not
823
+ Class: <SomeError>
824
+ Message: <"blah">
825
+ ---Backtrace---
826
+ FILE:LINE:in 'block in test_assert_raises__string_msg'
827
+ ---------------
828
+ EOM
829
+
830
+ actual = e.message.gsub(/^.+:\d+/, "FILE:LINE")
831
+ actual.gsub! RE_LEVELS, "" unless jruby?
832
+ actual.gsub!(/[`']block in (?:TestMinitestAssertions#)?/, "'block in ")
833
+
834
+ assert_equal expected, actual
835
+ end
836
+
837
+ def test_assert_raises__regexp_err
838
+ @assertion_count = 0
839
+
840
+ e = assert_raises TypeError do
841
+ @tc.assert_raises RuntimeError, %r%does not work%, "assertion message" do
842
+ raise SomeError, "blah"
843
+ end
844
+ end
845
+
846
+ expected = <<~EOM.chomp
847
+ class or module required for rescue clause. Got [RuntimeError, /does not work/]
848
+ EOM
849
+
850
+ actual = e.message
851
+
852
+ assert_equal expected, actual
853
+ end
854
+
855
+ def test_assert_raises__regexp_err_default
856
+ @assertion_count = 0
857
+
858
+ e = assert_raises TypeError do
859
+ @tc.assert_raises %r%does not work% do
860
+ raise "blah"
861
+ end
862
+ end
863
+
864
+ expected = <<~EOM.chomp
865
+ class or module required for rescue clause. Got [/does not work/]
866
+ EOM
867
+
868
+ actual = e.message
869
+
870
+ assert_equal expected, actual
871
+ end
872
+
813
873
  def test_assert_raises_subclass
814
874
  @tc.assert_raises StandardError do
815
875
  raise AnError
data.tar.gz.sig CHANGED
@@ -1,4 +1 @@
1
- �K�@��������yPd8��]������(���CI�� QZ���^���N�ɫ}z���c=�;H8� �vDYw��W�,h zS���O`E���c!�F���uH~��'Y!�̜�5u�?1d( ��� {ȵ#l�]�_��a�� m����q���m�<�KڷeL��,������
2
- ��b�@G!/�A�>��&X$Vވ6�
3
- ��(l{�e��u�8�X7`3l������j�*���4���� c
4
- �
1
+ �yt݆xByR����>lb�fp�OK��[�NZPA�;��C�e�M&@�}Ӻ��8��� $�'ȟ��El4k��=����ܢ�02°l*O�^p�OfM�psj��ڦ~R��SEJ��7J،���"� � >加�.z��iw0���Xqq+����W��TT�0�c2�*�˛D�>��O+=�614i�$ݣ�%Թ���2��U���P���C2���N9Z�C#ŗo"b�ݿ�Q@��j
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: 6.0.4
4
+ version: 6.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -98,14 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '4.6'
101
+ version: '4.7'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '4.6'
108
+ version: '4.7'
109
109
  description: |-
110
110
  minitest provides a complete suite of testing facilities supporting
111
111
  TDD, BDD, and benchmarking.
metadata.gz.sig CHANGED
Binary file