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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data/History.rdoc +14 -0
- data/lib/minitest/assertions.rb +10 -10
- data/lib/minitest/server_plugin.rb +1 -1
- data/lib/minitest.rb +1 -1
- data/test/minitest/test_minitest_assertions.rb +60 -0
- data.tar.gz.sig +1 -4
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bd5f764a0e5823b6af414ce7869ad229d5f417e901796475965dc869f81b0c3
|
|
4
|
+
data.tar.gz: b82a599afbc0ea6d9e4fe022fdf2fb20f81d875d012c57dd0db9cc7bf2a15acc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da7ef69a9a580f646ec8071574af269cc3c6a31055d2fbb5eecd6b4ba332338c91ad09469f85982b6882354e67fe82845636671bc8fd2cabe85db97497391d18
|
|
7
|
+
data.tar.gz: 05bad64ac6aa587be47737759231213c1ae86f2d7b78837392a6efddc3e7559b7f293a9d38056ed8dbcff868d601c2c6c2fea673a185da30d50d2c5193e164f7
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
��
|
|
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�.�� VkC�:B�����o�ȣ nN_zT�U]�
|
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:
|
data/lib/minitest/assertions.rb
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
710
|
+
refute nil == obj, msg
|
|
711
711
|
end
|
|
712
712
|
|
|
713
713
|
##
|
data/lib/minitest.rb
CHANGED
|
@@ -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
|
-
|
|
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��=����ܢ�0�2°l*O�^p�OfM�psj��ڦ~R��SEJ��7J،���"��>加�.z��iw0���Xqq+����W��T�T�0�c2�*�˛D�>��O+=�6�14i�$ݣ�%Թ���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
|
+
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.
|
|
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.
|
|
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
|