minitest 5.22.3 → 5.25.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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data/History.rdoc +95 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +15 -13
- data/Rakefile +6 -0
- data/lib/hoe/minitest.rb +2 -1
- data/lib/minitest/assertions.rb +64 -69
- data/lib/minitest/autorun.rb +0 -7
- data/lib/minitest/benchmark.rb +6 -9
- data/lib/minitest/compress.rb +10 -10
- data/lib/minitest/error_on_warning.rb +11 -0
- data/lib/minitest/manual_plugins.rb +16 -0
- data/lib/minitest/mock.rb +35 -17
- data/lib/minitest/parallel.rb +5 -5
- data/lib/minitest/pride_plugin.rb +10 -14
- data/lib/minitest/spec.rb +13 -12
- data/lib/minitest/test.rb +10 -22
- data/lib/minitest/test_task.rb +17 -11
- data/lib/minitest.rb +206 -136
- data/test/minitest/metametameta.rb +18 -10
- data/test/minitest/test_minitest_assertions.rb +133 -134
- data/test/minitest/test_minitest_benchmark.rb +1 -1
- data/test/minitest/test_minitest_mock.rb +150 -78
- data/test/minitest/test_minitest_reporter.rb +18 -22
- data/test/minitest/test_minitest_spec.rb +73 -56
- data/test/minitest/test_minitest_test.rb +84 -103
- data/test/minitest/test_minitest_test_task.rb +18 -9
- data.tar.gz.sig +0 -0
- metadata +5 -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: 7ea765a693b5e0ff21498e24a2880144f5e407283d225a6052dde11fbe6165a5
         | 
| 4 | 
            +
              data.tar.gz: 73f500c0dd7bbd0cbedcfa7c68d72da8f089f9397cd17d4a03e8f5bad0b40537
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1028ca9777f3dc15155dbe813565e886df7c6d1b69d3074fdae470784c4bd8f96ee49602d2ea048832a71647b84b2d42ab9dcba0c2d948b8ec1cfb40c0e304b3
         | 
| 7 | 
            +
              data.tar.gz: 05fb281d6ba736c47ade5c871472ab339ef8a7f14d68c88f9fbb7190d3f2e9c7d387f571e6d45fa9d25076b0794e6eb16cc993b79637b67e55996954e51678d8
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | @@ -1,2 +1,2 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            �� | 
| 1 | 
            +
            Akb�㢩��)8)����H�����sF=2�/�|d��b~8x�(K�h�ԡ`�m��F�`�Bz�	��`8��W�$G4m0�-r�p�7K��8}�Ҳ�LN�!�/:k�s���p�D]��k/c97�^	�GHN]�j��s-��~LK�o=���C
         | 
| 2 | 
            +
            y2��=O��Y&�&�0�0�?�N�ե��fW1���-�|��d��3���R�5O�+B_��)Cڡ���Q�#E�OLF}��&�����}��
         | 
    
        data/History.rdoc
    CHANGED
    
    | @@ -1,3 +1,98 @@ | |
| 1 | 
            +
            === 5.25.4 / 2024-12-03
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            * 1 bug fix:
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              * Fix for must_verify definition if only requiring minitest/mock (but why?).
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            === 5.25.3 / 2024-12-03
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            * 5 bug fixes:
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              * Fixed assert_mock to fail instead of raise on unmet mock expectations.
         | 
| 12 | 
            +
              * Fixed assert_mock to take an optional message argument.
         | 
| 13 | 
            +
              * Fixed formatting of unmet mock expectation messages.
         | 
| 14 | 
            +
              * Fixed missing must_verify expectation to match assert_mock.
         | 
| 15 | 
            +
              * minitest/pride: Fixed to use true colors with *-direct terminals (bk2204)
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            === 5.25.2 / 2024-11-21
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            * 4 bug fixes:
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              * Include class name in spec name. (thomasmarshall)
         | 
| 22 | 
            +
              * Fixed 'redefining object_id' warning from ruby 3.4. (mattbrictson)
         | 
| 23 | 
            +
              * Minitest top-level namespace no longer includes entire contents of README.rdoc. Too much!
         | 
| 24 | 
            +
              * Refactored spec's describe to more cleanly determine the superclass and name
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            === 5.25.1 / 2024-08-16
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            * 2 bug fixes:
         | 
| 29 | 
            +
             | 
| 30 | 
            +
              * Fix incompatibility caused by minitest-hooks & rails invading minitest internals.
         | 
| 31 | 
            +
              * Revert change from =~ to match? to allow for nil if $TERM undefined.
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            === 5.25.0 / 2024-08-13
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            * 2 minor enhancements:
         | 
| 36 | 
            +
             | 
| 37 | 
            +
              * Fixed some inefficiencies filtering and matching (mostly backtraces).
         | 
| 38 | 
            +
              * Refactored siginfo handler to reduce runtime costs. Saved ~30%!
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            * 5 bug fixes:
         | 
| 41 | 
            +
             | 
| 42 | 
            +
              * Added missing rdoc to get back to 100% coverage.
         | 
| 43 | 
            +
              * Cleaning up ancient code checking for defined?(Encoding) and the like.
         | 
| 44 | 
            +
              * Disambiguated some shadowed variables in minitest/compress.
         | 
| 45 | 
            +
              * Fixed an ironic bug if using string-literals AND Werror.
         | 
| 46 | 
            +
              * Improve description of test:slow task. (stomar)
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            === 5.24.1 / 2024-06-29
         | 
| 49 | 
            +
             | 
| 50 | 
            +
            * 1 bug fix:
         | 
| 51 | 
            +
             | 
| 52 | 
            +
              * Fix the error message when an extension is invalid value. (y-yagi)
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            === 5.24.0 / 2024-06-18
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            * 2 minor enhancements:
         | 
| 57 | 
            +
             | 
| 58 | 
            +
              * Added Minitest.register_plugin.
         | 
| 59 | 
            +
              * Extended plugin system to work with modules/classes for opt-out plugins.
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            * 1 bug fix:
         | 
| 62 | 
            +
             | 
| 63 | 
            +
              * Removed anacronism, but allow load_plugins to exit gracefully if --disable=gems.
         | 
| 64 | 
            +
             | 
| 65 | 
            +
            === 5.23.1 / 2024-05-21
         | 
| 66 | 
            +
             | 
| 67 | 
            +
            * 1 bug fix:
         | 
| 68 | 
            +
             | 
| 69 | 
            +
              * Fully qualify the Queue class to avoid conflicts with other libraries. (rafaelfranca)
         | 
| 70 | 
            +
             | 
| 71 | 
            +
            === 5.23.0 / 2024-05-15
         | 
| 72 | 
            +
             | 
| 73 | 
            +
            * 3 minor enhancements:
         | 
| 74 | 
            +
             | 
| 75 | 
            +
              * Added -Werror to raise on any warning output. (byroot)
         | 
| 76 | 
            +
              * Added UnexpectedWarning as a failure summary type, added count to output if activated.
         | 
| 77 | 
            +
              * Added minitest/manual_plugins.rb w/ new Minitest.load method. (tenderlove)
         | 
| 78 | 
            +
             | 
| 79 | 
            +
            * 2 bug fixes:
         | 
| 80 | 
            +
             | 
| 81 | 
            +
              * Allow empty_run! and reporter to display summary for empty runs. (zzak)
         | 
| 82 | 
            +
              * Make test task verbose using either rake's -v or -t (was just -t).
         | 
| 83 | 
            +
             | 
| 84 | 
            +
            === 5.22.3 / 2024-03-13
         | 
| 85 | 
            +
             | 
| 86 | 
            +
            * 1 minor enhancement:
         | 
| 87 | 
            +
             | 
| 88 | 
            +
              * MASSIVE improvement of minitest's pride plugin output: Frequencies doubled! Sine waves shifted!! Comments improved!!! Colors rotated!!!! (havenwood)
         | 
| 89 | 
            +
             | 
| 90 | 
            +
            * 3 bug fixes:
         | 
| 91 | 
            +
             | 
| 92 | 
            +
              * Improved wording on Minitest::Test#parallelize_me! to clarify it goes INSIDE your test class/describe.
         | 
| 93 | 
            +
              * Minor changes to tests to pass when tests ran with extra flags (eg -p).
         | 
| 94 | 
            +
              * Support Ruby 3.4's new error message format. (mame)
         | 
| 95 | 
            +
             | 
| 1 96 | 
             
            === 5.22.2 / 2024-02-07
         | 
| 2 97 |  | 
| 3 98 | 
             
            * 1 bug fix:
         | 
    
        data/Manifest.txt
    CHANGED
    
    | @@ -10,8 +10,10 @@ lib/minitest/assertions.rb | |
| 10 10 | 
             
            lib/minitest/autorun.rb
         | 
| 11 11 | 
             
            lib/minitest/benchmark.rb
         | 
| 12 12 | 
             
            lib/minitest/compress.rb
         | 
| 13 | 
            +
            lib/minitest/error_on_warning.rb
         | 
| 13 14 | 
             
            lib/minitest/expectations.rb
         | 
| 14 15 | 
             
            lib/minitest/hell.rb
         | 
| 16 | 
            +
            lib/minitest/manual_plugins.rb
         | 
| 15 17 | 
             
            lib/minitest/mock.rb
         | 
| 16 18 | 
             
            lib/minitest/parallel.rb
         | 
| 17 19 | 
             
            lib/minitest/pride.rb
         | 
    
        data/README.rdoc
    CHANGED
    
    | @@ -406,22 +406,23 @@ Using our example above, here is how we might implement MyCI: | |
| 406 406 |  | 
| 407 407 | 
             
            === What versions are compatible with what? Or what versions are supported?
         | 
| 408 408 |  | 
| 409 | 
            -
            Minitest is a dependency of rails, which until  | 
| 409 | 
            +
            Minitest is a dependency of rails, which until very recently had an
         | 
| 410 410 | 
             
            overzealous backwards compatibility policy. As such, I'm stuck
         | 
| 411 411 | 
             
            supporting versions of ruby that are long past EOL. Hopefully I'll be
         | 
| 412 412 | 
             
            able to support only current versions of ruby sometime in the near
         | 
| 413 413 | 
             
            future.
         | 
| 414 414 |  | 
| 415 | 
            -
            (As of  | 
| 415 | 
            +
            (As of 2024-05-10)
         | 
| 416 416 |  | 
| 417 417 | 
             
            Current versions of rails: (https://endoflife.date/rails)
         | 
| 418 418 |  | 
| 419 | 
            -
              | rails | min ruby |  | 
| 420 | 
            -
               | 
| 421 | 
            -
              |   7. | 
| 422 | 
            -
              |    | 
| 423 | 
            -
              |   6. | 
| 424 | 
            -
              |    | 
| 419 | 
            +
              | rails | min ruby | minitest | status   |  EOL Date  |
         | 
| 420 | 
            +
              |-------+----------+----------+----------+------------|
         | 
| 421 | 
            +
              |   7.1 | >= 2.7   | >= 5.1   | Current  | 2026-06-01?|
         | 
| 422 | 
            +
              |   7.0 | >= 2.7   | >= 5.1   | Maint    | 2025-06-01?|
         | 
| 423 | 
            +
              |   6.1 | >= 2.5   | >= 5.1   | Security | 2024-06-01?|
         | 
| 424 | 
            +
              |   6.0 | >= 2.5   | >= 5.1   | EOL      | 2023-06-01 |
         | 
| 425 | 
            +
              |   5.2 | >= 2.2.2 | ~> 5.1   | EOL      | 2022-06-01 |
         | 
| 425 426 |  | 
| 426 427 | 
             
            If you want to look at the requirements for a specific version, run:
         | 
| 427 428 |  | 
| @@ -431,12 +432,13 @@ Current versions of ruby: (https://endoflife.date/ruby) | |
| 431 432 |  | 
| 432 433 | 
             
              | ruby | Status  |   EOL Date |
         | 
| 433 434 | 
             
              |------+---------+------------|
         | 
| 434 | 
            -
              |  3. | 
| 435 | 
            -
              |  3. | 
| 436 | 
            -
              |  3. | 
| 437 | 
            -
              |   | 
| 435 | 
            +
              |  3.3 | Current | 2027-03-31 |
         | 
| 436 | 
            +
              |  3.2 | Maint   | 2026-03-31 |
         | 
| 437 | 
            +
              |  3.1 | Security| 2025-03-31 |
         | 
| 438 | 
            +
              |  3.0 | EOL     | 2024-03-31 |
         | 
| 439 | 
            +
              |  2.7 | EOL     | 2023-03-31 |
         | 
| 438 440 | 
             
              |  2.6 | EOL     | 2022-03-31 |
         | 
| 439 | 
            -
              |  2.5 | EOL     | 2021-03-31 |
         | 
| 441 | 
            +
              |  2.5 | EOL     | 2021-03-31 | DO YOU SEE WHAT I'M STUCK WITH???
         | 
| 440 442 |  | 
| 441 443 | 
             
            === How to test SimpleDelegates?
         | 
| 442 444 |  | 
    
        data/Rakefile
    CHANGED
    
    | @@ -33,6 +33,7 @@ task :specs do | |
| 33 33 | 
             
                /_includes/                            => "_include",
         | 
| 34 34 | 
             
                /(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
         | 
| 35 35 | 
             
                /must_raises/                          => "must_raise",
         | 
| 36 | 
            +
                /(must|wont)_pattern/                  => '\1_pattern_match',
         | 
| 36 37 | 
             
                /(must|wont)_predicate/                => '\1_be',
         | 
| 37 38 | 
             
                /(must|wont)_path_exists/              => 'path_\1_exist',
         | 
| 38 39 | 
             
              }
         | 
| @@ -72,4 +73,9 @@ task :bugs do | |
| 72 73 | 
             
              sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
         | 
| 73 74 | 
             
            end
         | 
| 74 75 |  | 
| 76 | 
            +
            Minitest::TestTask.create :testW0 do |t|
         | 
| 77 | 
            +
              t.warning = false
         | 
| 78 | 
            +
              t.test_prelude = "$-w = nil"
         | 
| 79 | 
            +
            end
         | 
| 80 | 
            +
             | 
| 75 81 | 
             
            # vim: syntax=Ruby
         | 
    
        data/lib/hoe/minitest.rb
    CHANGED
    
    | @@ -1,6 +1,7 @@ | |
| 1 1 | 
             
            # :stopdoc:
         | 
| 2 2 |  | 
| 3 3 | 
             
            class Hoe
         | 
| 4 | 
            +
              # empty
         | 
| 4 5 | 
             
            end
         | 
| 5 6 |  | 
| 6 7 | 
             
            module Hoe::Minitest
         | 
| @@ -16,7 +17,7 @@ module Hoe::Minitest | |
| 16 17 |  | 
| 17 18 | 
             
                gem "minitest"
         | 
| 18 19 | 
             
                require "minitest"
         | 
| 19 | 
            -
                version = Minitest::VERSION.split( | 
| 20 | 
            +
                version = Minitest::VERSION.split(".").first(2).join "."
         | 
| 20 21 |  | 
| 21 22 | 
             
                dependency "minitest", "~> #{version}", :development unless
         | 
| 22 23 | 
             
                  minitest? or ENV["MT_NO_ISOLATE"]
         | 
    
        data/lib/minitest/assertions.rb
    CHANGED
    
    | @@ -1,5 +1,3 @@ | |
| 1 | 
            -
            # encoding: UTF-8
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            require "rbconfig"
         | 
| 4 2 | 
             
            require "tempfile"
         | 
| 5 3 | 
             
            require "stringio"
         | 
| @@ -29,12 +27,12 @@ module Minitest | |
| 29 27 | 
             
                def self.diff
         | 
| 30 28 | 
             
                  return @diff if defined? @diff
         | 
| 31 29 |  | 
| 32 | 
            -
                  @diff = if (RbConfig::CONFIG["host_os"] =~ /mswin|mingw/  | 
| 33 | 
            -
                              system | 
| 30 | 
            +
                  @diff = if (RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ and
         | 
| 31 | 
            +
                              system "diff.exe", __FILE__, __FILE__) then
         | 
| 34 32 | 
             
                            "diff.exe -u"
         | 
| 35 | 
            -
                          elsif system | 
| 33 | 
            +
                          elsif system "gdiff", __FILE__, __FILE__ then
         | 
| 36 34 | 
             
                            "gdiff -u" # solaris and kin suck
         | 
| 37 | 
            -
                          elsif system | 
| 35 | 
            +
                          elsif system "diff", __FILE__, __FILE__ then
         | 
| 38 36 | 
             
                            "diff -u"
         | 
| 39 37 | 
             
                          else
         | 
| 40 38 | 
             
                            nil
         | 
| @@ -59,16 +57,16 @@ module Minitest | |
| 59 57 | 
             
                def diff exp, act
         | 
| 60 58 | 
             
                  result = nil
         | 
| 61 59 |  | 
| 62 | 
            -
                  expect, butwas = things_to_diff | 
| 60 | 
            +
                  expect, butwas = things_to_diff exp, act
         | 
| 63 61 |  | 
| 64 62 | 
             
                  return "Expected: #{mu_pp exp}\n  Actual: #{mu_pp act}" unless
         | 
| 65 63 | 
             
                    expect
         | 
| 66 64 |  | 
| 67 | 
            -
                  Tempfile.open | 
| 65 | 
            +
                  Tempfile.open "expect" do |a|
         | 
| 68 66 | 
             
                    a.puts expect
         | 
| 69 67 | 
             
                    a.flush
         | 
| 70 68 |  | 
| 71 | 
            -
                    Tempfile.open | 
| 69 | 
            +
                    Tempfile.open "butwas" do |b|
         | 
| 72 70 | 
             
                      b.puts butwas
         | 
| 73 71 | 
             
                      b.flush
         | 
| 74 72 |  | 
| @@ -79,10 +77,10 @@ module Minitest | |
| 79 77 | 
             
                      if result.empty? then
         | 
| 80 78 | 
             
                        klass = exp.class
         | 
| 81 79 | 
             
                        result = [
         | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 80 | 
            +
                                   "No visible difference in the #{klass}#inspect output.\n",
         | 
| 81 | 
            +
                                   "You should look at the implementation of #== on ",
         | 
| 82 | 
            +
                                   "#{klass} or its members.\n",
         | 
| 83 | 
            +
                                   expect,
         | 
| 86 84 | 
             
                                 ].join
         | 
| 87 85 | 
             
                      end
         | 
| 88 86 | 
             
                    end
         | 
| @@ -127,20 +125,15 @@ module Minitest | |
| 127 125 | 
             
                # See Minitest::Test.make_my_diffs_pretty!
         | 
| 128 126 |  | 
| 129 127 | 
             
                def mu_pp obj
         | 
| 130 | 
            -
                  s = obj.inspect
         | 
| 128 | 
            +
                  s = obj.inspect.encode Encoding.default_external
         | 
| 131 129 |  | 
| 132 | 
            -
                   | 
| 133 | 
            -
                     | 
| 130 | 
            +
                  return s unless String === obj &&
         | 
| 131 | 
            +
                    (obj.encoding != Encoding.default_external || !obj.valid_encoding?)
         | 
| 134 132 |  | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 137 | 
            -
                      enc = "# encoding: #{obj.encoding}"
         | 
| 138 | 
            -
                      val = "#    valid: #{obj.valid_encoding?}"
         | 
| 139 | 
            -
                      s = "#{enc}\n#{val}\n#{s}"
         | 
| 140 | 
            -
                    end
         | 
| 141 | 
            -
                  end
         | 
| 133 | 
            +
                  enc = "# encoding: #{obj.encoding}"
         | 
| 134 | 
            +
                  val = "#    valid: #{obj.valid_encoding?}"
         | 
| 142 135 |  | 
| 143 | 
            -
                  s
         | 
| 136 | 
            +
                  [enc, val, s].join "\n"
         | 
| 144 137 | 
             
                end
         | 
| 145 138 |  | 
| 146 139 | 
             
                ##
         | 
| @@ -153,8 +146,8 @@ module Minitest | |
| 153 146 | 
             
                  str = mu_pp obj
         | 
| 154 147 |  | 
| 155 148 | 
             
                  # both '\n' & '\\n' (_after_ mu_pp (aka inspect))
         | 
| 156 | 
            -
                  single =  | 
| 157 | 
            -
                  double =  | 
| 149 | 
            +
                  single = str.match?(/(?<!\\|^)\\n/)
         | 
| 150 | 
            +
                  double = str.match?(/(?<=\\|^)\\n/)
         | 
| 158 151 |  | 
| 159 152 | 
             
                  process =
         | 
| 160 153 | 
             
                    if single ^ double then
         | 
| @@ -167,9 +160,9 @@ module Minitest | |
| 167 160 | 
             
                      :itself                                     # leave it alone
         | 
| 168 161 | 
             
                    end
         | 
| 169 162 |  | 
| 170 | 
            -
                  str | 
| 171 | 
            -
                    gsub(/\\?\\n/, &process) | 
| 172 | 
            -
                    gsub(/:0x[a-fA-F0-9]{4,}/m, ":0xXXXXXX") # anonymize hex values
         | 
| 163 | 
            +
                  str
         | 
| 164 | 
            +
                    .gsub(/\\?\\n/, &process)
         | 
| 165 | 
            +
                    .gsub(/:0x[a-fA-F0-9]{4,}/m, ":0xXXXXXX") # anonymize hex values
         | 
| 173 166 | 
             
                end
         | 
| 174 167 |  | 
| 175 168 | 
             
                ##
         | 
| @@ -193,14 +186,14 @@ module Minitest | |
| 193 186 | 
             
                # Fails unless +obj+ is empty.
         | 
| 194 187 |  | 
| 195 188 | 
             
                def assert_empty obj, msg = nil
         | 
| 196 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 189 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to be empty" }
         | 
| 197 190 | 
             
                  assert_respond_to obj, :empty?
         | 
| 198 191 | 
             
                  assert obj.empty?, msg
         | 
| 199 192 | 
             
                end
         | 
| 200 193 |  | 
| 201 194 | 
             
                def _where # :nodoc:
         | 
| 202 | 
            -
                   | 
| 203 | 
            -
             | 
| 195 | 
            +
                  Minitest.filter_backtrace(caller).first
         | 
| 196 | 
            +
                    .split(":in ", 2).first # clean up noise
         | 
| 204 197 | 
             
                end
         | 
| 205 198 |  | 
| 206 199 | 
             
                E = "" # :nodoc:
         | 
| @@ -223,7 +216,7 @@ module Minitest | |
| 223 216 | 
             
                  result = assert exp == act, msg
         | 
| 224 217 |  | 
| 225 218 | 
             
                  if nil == exp then
         | 
| 226 | 
            -
                    if Minitest::VERSION  | 
| 219 | 
            +
                    if Minitest::VERSION >= "6" then
         | 
| 227 220 | 
             
                      refute_nil exp, "Use assert_nil if expecting nil."
         | 
| 228 221 | 
             
                    else
         | 
| 229 222 | 
             
                      warn "DEPRECATED: Use assert_nil if expecting nil from #{_where}. This will fail in Minitest 6."
         | 
| @@ -260,7 +253,7 @@ module Minitest | |
| 260 253 |  | 
| 261 254 | 
             
                def assert_includes collection, obj, msg = nil
         | 
| 262 255 | 
             
                  msg = message(msg) {
         | 
| 263 | 
            -
                    "Expected #{mu_pp | 
| 256 | 
            +
                    "Expected #{mu_pp collection} to include #{mu_pp obj}"
         | 
| 264 257 | 
             
                  }
         | 
| 265 258 | 
             
                  assert_respond_to collection, :include?
         | 
| 266 259 | 
             
                  assert collection.include?(obj), msg
         | 
| @@ -271,7 +264,7 @@ module Minitest | |
| 271 264 |  | 
| 272 265 | 
             
                def assert_instance_of cls, obj, msg = nil
         | 
| 273 266 | 
             
                  msg = message(msg) {
         | 
| 274 | 
            -
                    "Expected #{mu_pp | 
| 267 | 
            +
                    "Expected #{mu_pp obj} to be an instance of #{cls}, not #{obj.class}"
         | 
| 275 268 | 
             
                  }
         | 
| 276 269 |  | 
| 277 270 | 
             
                  assert obj.instance_of?(cls), msg
         | 
| @@ -282,7 +275,8 @@ module Minitest | |
| 282 275 |  | 
| 283 276 | 
             
                def assert_kind_of cls, obj, msg = nil
         | 
| 284 277 | 
             
                  msg = message(msg) {
         | 
| 285 | 
            -
                    "Expected #{mu_pp | 
| 278 | 
            +
                    "Expected #{mu_pp obj} to be a kind of #{cls}, not #{obj.class}"
         | 
| 279 | 
            +
                  }
         | 
| 286 280 |  | 
| 287 281 | 
             
                  assert obj.kind_of?(cls), msg
         | 
| 288 282 | 
             
                end
         | 
| @@ -292,7 +286,7 @@ module Minitest | |
| 292 286 |  | 
| 293 287 | 
             
                def assert_match matcher, obj, msg = nil
         | 
| 294 288 | 
             
                  msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
         | 
| 295 | 
            -
                  assert_respond_to matcher,  | 
| 289 | 
            +
                  assert_respond_to matcher, :=~
         | 
| 296 290 | 
             
                  matcher = Regexp.new Regexp.escape matcher if String === matcher
         | 
| 297 291 | 
             
                  assert matcher =~ obj, msg
         | 
| 298 292 |  | 
| @@ -303,7 +297,7 @@ module Minitest | |
| 303 297 | 
             
                # Fails unless +obj+ is nil
         | 
| 304 298 |  | 
| 305 299 | 
             
                def assert_nil obj, msg = nil
         | 
| 306 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 300 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to be nil" }
         | 
| 307 301 | 
             
                  assert obj.nil?, msg
         | 
| 308 302 | 
             
                end
         | 
| 309 303 |  | 
| @@ -314,7 +308,7 @@ module Minitest | |
| 314 308 |  | 
| 315 309 | 
             
                def assert_operator o1, op, o2 = UNDEFINED, msg = nil
         | 
| 316 310 | 
             
                  return assert_predicate o1, op, msg if UNDEFINED == o2
         | 
| 317 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 311 | 
            +
                  msg = message(msg) { "Expected #{mu_pp o1} to be #{op} #{mu_pp o2}" }
         | 
| 318 312 | 
             
                  assert o1.__send__(op, o2), msg
         | 
| 319 313 | 
             
                end
         | 
| 320 314 |  | 
| @@ -395,7 +389,7 @@ module Minitest | |
| 395 389 | 
             
                #   str.must_be :empty?
         | 
| 396 390 |  | 
| 397 391 | 
             
                def assert_predicate o1, op, msg = nil
         | 
| 398 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 392 | 
            +
                  msg = message(msg) { "Expected #{mu_pp o1} to be #{op}" }
         | 
| 399 393 | 
             
                  assert o1.__send__(op), msg
         | 
| 400 394 | 
             
                end
         | 
| 401 395 |  | 
| @@ -440,13 +434,13 @@ module Minitest | |
| 440 434 | 
             
                    raise
         | 
| 441 435 | 
             
                  rescue Exception => e
         | 
| 442 436 | 
             
                    flunk proc {
         | 
| 443 | 
            -
                      exception_details(e, "#{msg}#{mu_pp | 
| 437 | 
            +
                      exception_details(e, "#{msg}#{mu_pp exp} exception expected, not")
         | 
| 444 438 | 
             
                    }
         | 
| 445 439 | 
             
                  end
         | 
| 446 440 |  | 
| 447 441 | 
             
                  exp = exp.first if exp.size == 1
         | 
| 448 442 |  | 
| 449 | 
            -
                  flunk "#{msg}#{mu_pp | 
| 443 | 
            +
                  flunk "#{msg}#{mu_pp exp} expected but nothing was raised."
         | 
| 450 444 | 
             
                end
         | 
| 451 445 |  | 
| 452 446 | 
             
                ##
         | 
| @@ -455,7 +449,7 @@ module Minitest | |
| 455 449 |  | 
| 456 450 | 
             
                def assert_respond_to obj, meth, msg = nil, include_all: false
         | 
| 457 451 | 
             
                  msg = message(msg) {
         | 
| 458 | 
            -
                    "Expected #{mu_pp | 
| 452 | 
            +
                    "Expected #{mu_pp obj} (#{obj.class}) to respond to ##{meth}"
         | 
| 459 453 | 
             
                  }
         | 
| 460 454 | 
             
                  assert obj.respond_to?(meth, include_all), msg
         | 
| 461 455 | 
             
                end
         | 
| @@ -481,7 +475,8 @@ module Minitest | |
| 481 475 |  | 
| 482 476 | 
             
                  recv, msg, *args = send_ary
         | 
| 483 477 | 
             
                  m = message(m) {
         | 
| 484 | 
            -
                    "Expected #{mu_pp | 
| 478 | 
            +
                    "Expected #{mu_pp recv}.#{msg}(*#{mu_pp args}) to return true"
         | 
| 479 | 
            +
                  }
         | 
| 485 480 | 
             
                  assert recv.__send__(msg, *args), m
         | 
| 486 481 | 
             
                end
         | 
| 487 482 |  | 
| @@ -500,15 +495,15 @@ module Minitest | |
| 500 495 | 
             
                # Fails unless the block throws +sym+
         | 
| 501 496 |  | 
| 502 497 | 
             
                def assert_throws sym, msg = nil
         | 
| 503 | 
            -
                  default = "Expected #{mu_pp | 
| 498 | 
            +
                  default = "Expected #{mu_pp sym} to have been thrown"
         | 
| 504 499 | 
             
                  caught = true
         | 
| 505 | 
            -
                  value = catch | 
| 500 | 
            +
                  value = catch sym do
         | 
| 506 501 | 
             
                    begin
         | 
| 507 502 | 
             
                      yield
         | 
| 508 503 | 
             
                    rescue ThreadError => e       # wtf?!? 1.8 + threads == suck
         | 
| 509 | 
            -
                      default += ", not  | 
| 504 | 
            +
                      default += ", not :#{e.message[/uncaught throw \`(\w+?)\'/, 1]}"
         | 
| 510 505 | 
             
                    rescue ArgumentError => e     # 1.9 exception
         | 
| 511 | 
            -
                      raise e unless e.message.include? | 
| 506 | 
            +
                      raise e unless e.message.include? "uncaught throw"
         | 
| 512 507 | 
             
                      default += ", not #{e.message.split(/ /).last}"
         | 
| 513 508 | 
             
                    rescue NameError => e         # 1.8 exception
         | 
| 514 509 | 
             
                      raise e unless e.name == sym
         | 
| @@ -607,12 +602,12 @@ module Minitest | |
| 607 602 |  | 
| 608 603 | 
             
                def exception_details e, msg
         | 
| 609 604 | 
             
                  [
         | 
| 610 | 
            -
             | 
| 611 | 
            -
             | 
| 612 | 
            -
             | 
| 613 | 
            -
             | 
| 614 | 
            -
             | 
| 615 | 
            -
             | 
| 605 | 
            +
                    msg,
         | 
| 606 | 
            +
                    "Class: <#{e.class}>",
         | 
| 607 | 
            +
                    "Message: <#{e.message.inspect}>",
         | 
| 608 | 
            +
                    "---Backtrace---",
         | 
| 609 | 
            +
                    Minitest.filter_backtrace(e.backtrace),
         | 
| 610 | 
            +
                    "---------------",
         | 
| 616 611 | 
             
                  ].join "\n"
         | 
| 617 612 | 
             
                end
         | 
| 618 613 |  | 
| @@ -621,7 +616,7 @@ module Minitest | |
| 621 616 | 
             
                # you to put time-bombs in your tests if you need to keep
         | 
| 622 617 | 
             
                # something around until a later date lest you forget about it.
         | 
| 623 618 |  | 
| 624 | 
            -
                def fail_after y,m,d,msg
         | 
| 619 | 
            +
                def fail_after y, m, d, msg
         | 
| 625 620 | 
             
                  flunk msg if Time.now > Time.local(y, m, d)
         | 
| 626 621 | 
             
                end
         | 
| 627 622 |  | 
| @@ -655,7 +650,7 @@ module Minitest | |
| 655 650 | 
             
                # Fails if +test+ is truthy.
         | 
| 656 651 |  | 
| 657 652 | 
             
                def refute test, msg = nil
         | 
| 658 | 
            -
                  msg ||= message { "Expected #{mu_pp | 
| 653 | 
            +
                  msg ||= message { "Expected #{mu_pp test} to not be truthy" }
         | 
| 659 654 | 
             
                  assert !test, msg
         | 
| 660 655 | 
             
                end
         | 
| 661 656 |  | 
| @@ -663,7 +658,7 @@ module Minitest | |
| 663 658 | 
             
                # Fails if +obj+ is empty.
         | 
| 664 659 |  | 
| 665 660 | 
             
                def refute_empty obj, msg = nil
         | 
| 666 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 661 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to not be empty" }
         | 
| 667 662 | 
             
                  assert_respond_to obj, :empty?
         | 
| 668 663 | 
             
                  refute obj.empty?, msg
         | 
| 669 664 | 
             
                end
         | 
| @@ -675,7 +670,7 @@ module Minitest | |
| 675 670 |  | 
| 676 671 | 
             
                def refute_equal exp, act, msg = nil
         | 
| 677 672 | 
             
                  msg = message(msg) {
         | 
| 678 | 
            -
                    "Expected #{mu_pp | 
| 673 | 
            +
                    "Expected #{mu_pp act} to not be equal to #{mu_pp exp}"
         | 
| 679 674 | 
             
                  }
         | 
| 680 675 | 
             
                  refute exp == act, msg
         | 
| 681 676 | 
             
                end
         | 
| @@ -706,7 +701,7 @@ module Minitest | |
| 706 701 |  | 
| 707 702 | 
             
                def refute_includes collection, obj, msg = nil
         | 
| 708 703 | 
             
                  msg = message(msg) {
         | 
| 709 | 
            -
                    "Expected #{mu_pp | 
| 704 | 
            +
                    "Expected #{mu_pp collection} to not include #{mu_pp obj}"
         | 
| 710 705 | 
             
                  }
         | 
| 711 706 | 
             
                  assert_respond_to collection, :include?
         | 
| 712 707 | 
             
                  refute collection.include?(obj), msg
         | 
| @@ -717,7 +712,7 @@ module Minitest | |
| 717 712 |  | 
| 718 713 | 
             
                def refute_instance_of cls, obj, msg = nil
         | 
| 719 714 | 
             
                  msg = message(msg) {
         | 
| 720 | 
            -
                    "Expected #{mu_pp | 
| 715 | 
            +
                    "Expected #{mu_pp obj} to not be an instance of #{cls}"
         | 
| 721 716 | 
             
                  }
         | 
| 722 717 | 
             
                  refute obj.instance_of?(cls), msg
         | 
| 723 718 | 
             
                end
         | 
| @@ -726,7 +721,7 @@ module Minitest | |
| 726 721 | 
             
                # Fails if +obj+ is a kind of +cls+.
         | 
| 727 722 |  | 
| 728 723 | 
             
                def refute_kind_of cls, obj, msg = nil
         | 
| 729 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 724 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to not be a kind of #{cls}" }
         | 
| 730 725 | 
             
                  refute obj.kind_of?(cls), msg
         | 
| 731 726 | 
             
                end
         | 
| 732 727 |  | 
| @@ -735,7 +730,7 @@ module Minitest | |
| 735 730 |  | 
| 736 731 | 
             
                def refute_match matcher, obj, msg = nil
         | 
| 737 732 | 
             
                  msg = message(msg) { "Expected #{mu_pp matcher} to not match #{mu_pp obj}" }
         | 
| 738 | 
            -
                  assert_respond_to matcher,  | 
| 733 | 
            +
                  assert_respond_to matcher, :=~
         | 
| 739 734 | 
             
                  matcher = Regexp.new Regexp.escape matcher if String === matcher
         | 
| 740 735 | 
             
                  refute matcher =~ obj, msg
         | 
| 741 736 | 
             
                end
         | 
| @@ -744,7 +739,7 @@ module Minitest | |
| 744 739 | 
             
                # Fails if +obj+ is nil.
         | 
| 745 740 |  | 
| 746 741 | 
             
                def refute_nil obj, msg = nil
         | 
| 747 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 742 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to not be nil" }
         | 
| 748 743 | 
             
                  refute obj.nil?, msg
         | 
| 749 744 | 
             
                end
         | 
| 750 745 |  | 
| @@ -766,7 +761,7 @@ module Minitest | |
| 766 761 |  | 
| 767 762 | 
             
                  begin
         | 
| 768 763 | 
             
                    yield
         | 
| 769 | 
            -
                    flunk | 
| 764 | 
            +
                    flunk "NoMatchingPatternError expected, but nothing was raised."
         | 
| 770 765 | 
             
                  rescue NoMatchingPatternError
         | 
| 771 766 | 
             
                    pass
         | 
| 772 767 | 
             
                  end
         | 
| @@ -780,7 +775,7 @@ module Minitest | |
| 780 775 |  | 
| 781 776 | 
             
                def refute_operator o1, op, o2 = UNDEFINED, msg = nil
         | 
| 782 777 | 
             
                  return refute_predicate o1, op, msg if UNDEFINED == o2
         | 
| 783 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 778 | 
            +
                  msg = message(msg) { "Expected #{mu_pp o1} to not be #{op} #{mu_pp o2}" }
         | 
| 784 779 | 
             
                  refute o1.__send__(op, o2), msg
         | 
| 785 780 | 
             
                end
         | 
| 786 781 |  | 
| @@ -802,7 +797,7 @@ module Minitest | |
| 802 797 | 
             
                #   str.wont_be :empty?
         | 
| 803 798 |  | 
| 804 799 | 
             
                def refute_predicate o1, op, msg = nil
         | 
| 805 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 800 | 
            +
                  msg = message(msg) { "Expected #{mu_pp o1} to not be #{op}" }
         | 
| 806 801 | 
             
                  refute o1.__send__(op), msg
         | 
| 807 802 | 
             
                end
         | 
| 808 803 |  | 
| @@ -811,7 +806,7 @@ module Minitest | |
| 811 806 | 
             
                # include_all defaults to false to match Object#respond_to?
         | 
| 812 807 |  | 
| 813 808 | 
             
                def refute_respond_to obj, meth, msg = nil, include_all: false
         | 
| 814 | 
            -
                  msg = message(msg) { "Expected #{mu_pp | 
| 809 | 
            +
                  msg = message(msg) { "Expected #{mu_pp obj} to not respond to #{meth}" }
         | 
| 815 810 |  | 
| 816 811 | 
             
                  refute obj.respond_to?(meth, include_all), msg
         | 
| 817 812 | 
             
                end
         | 
| @@ -844,9 +839,9 @@ module Minitest | |
| 844 839 | 
             
                # date, but still holds you accountable and prevents you from
         | 
| 845 840 | 
             
                # forgetting it.
         | 
| 846 841 |  | 
| 847 | 
            -
                def skip_until y,m,d,msg
         | 
| 842 | 
            +
                def skip_until y, m, d, msg
         | 
| 848 843 | 
             
                  skip msg if Time.now < Time.local(y, m, d)
         | 
| 849 | 
            -
                  where = caller.first.rpartition( | 
| 844 | 
            +
                  where = caller(1..1).first.rpartition(":in").reject(&:empty?).first
         | 
| 850 845 | 
             
                  warn "Stale skip_until %p at %s" % [msg, where]
         | 
| 851 846 | 
             
                end
         | 
| 852 847 |  |