minitest 5.16.2 → 5.16.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8a4c5be93a57704279d69e9de71e39a726d553e5f8e75ef98fca8606b5543bf
4
- data.tar.gz: e821d2c514f6fdc21698c3b6f1c1dbba39de57817c1c7710881082cdce382371
3
+ metadata.gz: 9c5a4db9f495b34c86f2c39eef6b6d424b22d8d9e6a86038bf0ff84c1c20c975
4
+ data.tar.gz: b8a1b6cb226d14c6972460bec05ec610d05acdfa0edcffe19bf51e8220486206
5
5
  SHA512:
6
- metadata.gz: 35335793acd5044353c3fae7e59f62c15ed321f8637e20aef8fa82269c1e2d1670f2ef92363cd94c56708e2eae50d95e7b22fed3a35219c2010f4c6a40748f9c
7
- data.tar.gz: 41540290647a9fd33739b43f99bff035c4371f0f0d3e4021e8e2502fd4c02f0e10efb787ca48e31276a59c64e627a837515bbeb9e6795bb48e6f89b704c007a8
6
+ metadata.gz: 6505a8f386da89263a005ba8eef3f81053e7e666a54ec03abd8f71e06c290ebf318df4f7728e420e3f40fab55ffe1a57824ec435286c89864ea830d330d6b028
7
+ data.tar.gz: 5b8bbba7d8565026e64da1d3af31a5aa342c3d063acd75de9661bc09fb142f4a469e9febf44daf2764d4fb33021d993a27bd936200efded501158b23c299989e
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 5.16.3 / 2022-08-17
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fixed exception sanitization by removing TypeError restriction on rescue.
6
+ * Use A instead of deprecated TESTOPTS in rake test:slow. (davidstosik)
7
+
1
8
  === 5.16.2 / 2022-07-03
2
9
 
3
10
  * 4 bug fixes:
data/README.rdoc CHANGED
@@ -641,6 +641,7 @@ minitest-capistrano :: Assertions and expectations for testing
641
641
  Capistrano recipes.
642
642
  minitest-capybara :: Capybara matchers support for minitest unit and
643
643
  spec.
644
+ minitest-cc :: It provides minimal information about code coverage.
644
645
  minitest-chef-handler :: Run Minitest suites as Chef report handlers
645
646
  minitest-ci :: CI reporter plugin for Minitest.
646
647
  minitest-context :: Defines contexts for code reuse in Minitest
@@ -739,7 +740,7 @@ minitest-stub-const :: Stub constants for the duration of a block.
739
740
  minitest-tags :: Add tags for minitest.
740
741
  minitest-unordered :: Adds a new assertion to minitest for checking the
741
742
  contents of a collection, ignoring element order.
742
- minitest-vcr :: Automatic cassette managment with Minitest::Spec
743
+ minitest-vcr :: Automatic cassette management with Minitest::Spec
743
744
  and VCR.
744
745
  minitest_log :: Adds structured logging, data explication, and verdicts.
745
746
  minitest_owrapper :: Get tests results as a TestResult object.
data/lib/minitest/test.rb CHANGED
@@ -204,7 +204,7 @@ module Minitest
204
204
  def sanitize_exception e # :nodoc:
205
205
  Marshal.dump e
206
206
  e # good: use as-is
207
- rescue TypeError
207
+ rescue
208
208
  neuter_exception e
209
209
  end
210
210
 
@@ -213,7 +213,7 @@ module Minitest
213
213
  msg = e.message.dup
214
214
 
215
215
  new_exception e.class, msg, bt # e.class can be a problem...
216
- rescue TypeError
216
+ rescue
217
217
  msg.prepend "Neutered Exception #{e.class}: "
218
218
 
219
219
  new_exception RuntimeError, msg, bt, true # but if this raises, we die
@@ -238,7 +238,7 @@ module Minitest # :nodoc:
238
238
 
239
239
  desc "Show bottom 25 tests wrt time."
240
240
  task "#{name}:slow" do
241
- sh ["rake #{name} TESTOPTS=-v",
241
+ sh ["rake #{name} A=-v",
242
242
  "egrep '#test_.* s = .'",
243
243
  "sort -n -k2 -t=",
244
244
  "tail -25"].join " | "
data/lib/minitest.rb CHANGED
@@ -9,7 +9,7 @@ require "etc"
9
9
  # :include: README.rdoc
10
10
 
11
11
  module Minitest
12
- VERSION = "5.16.2" # :nodoc:
12
+ VERSION = "5.16.3" # :nodoc:
13
13
 
14
14
  @@installed_at_exit ||= false
15
15
  @@after_run = []
@@ -942,6 +942,49 @@ class TestMinitestRunnable < Minitest::Test
942
942
  assert_equal @tc.failures, over_the_wire.failures
943
943
  assert_equal @tc.klass, over_the_wire.klass
944
944
  end
945
+
946
+ def test_spec_marshal_with_exception__worse_error_typeerror
947
+ worse_error_klass = Class.new(StandardError) do
948
+ # problem #1: anonymous subclass can'tmarshal, fails sanitize_exception
949
+ def initialize(record = nil)
950
+
951
+ super(record.first)
952
+ end
953
+ end
954
+
955
+ klass = describe("whatever") {
956
+ it("raises with NoMethodError") {
957
+ # problem #2: instantiated with a NON-string argument
958
+ #
959
+ # problem #3: arg responds to #first, but it becomes message
960
+ # which gets passed back in via new_exception
961
+ # that passes a string to worse_error_klass#initialize
962
+ # which calls first on it, which raises NoMethodError
963
+ raise worse_error_klass.new(["boom"])
964
+ }
965
+ }
966
+
967
+ rm = klass.runnable_methods.first
968
+
969
+ # Run the test
970
+ @tc = klass.new(rm).run
971
+
972
+ assert_kind_of Minitest::Result, @tc
973
+ assert_instance_of Minitest::UnexpectedError, @tc.failure
974
+
975
+ msg = @tc.failure.error.message.gsub(/0x[A-Fa-f0-9]+/, "0xXXX")
976
+
977
+ assert_equal "Neutered Exception #<Class:0xXXX>: boom", msg
978
+
979
+ # Pass it over the wire
980
+ over_the_wire = Marshal.load Marshal.dump @tc
981
+
982
+ assert_equal @tc.time, over_the_wire.time
983
+ assert_equal @tc.name, over_the_wire.name
984
+ assert_equal @tc.assertions, over_the_wire.assertions
985
+ assert_equal @tc.failures, over_the_wire.failures
986
+ assert_equal @tc.klass, over_the_wire.klass
987
+ end
945
988
  end
946
989
 
947
990
  class TestMinitestTest < TestMinitestRunnable
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- mڕaE�O;i�2�6�I�u�cseM6ʑ�l󈟛w� 9���%;�q��?X� ��5��N�sϠnN�՝)��_+���VR���ל�V����r����!1u��;NG'���]|�H��0T�w��[���-'��'{�7ir���u���U��P6hj
2
- �>� ����pߪ�M�O<��Krz ����!�u���'c�{�O�Mz�!� ���|@�΄��CՌiv��:u���\�t��Zd:
1
+ ��#3)�~<Lp1���=�ܞb���qG���,]�x,_�.f��� ��|Wqng�:����ۊ���-5
2
+ �3W P�fG&�����TU�5���tj�Ͷ�AoRvn�ܿ����h��������V�ڌ�Xh3�G׏p��g���|\%dLY#��De�=p�={����t�,I���L�����i���2-��$�~�z����]6FM{t/֦yϭ
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.16.2
4
+ version: 5.16.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
30
30
  YsuyUzsMz6GQA4khyaMgKNSD
31
31
  -----END CERTIFICATE-----
32
- date: 2022-07-03 00:00:00.000000000 Z
32
+ date: 2022-08-17 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
metadata.gz.sig CHANGED
Binary file