Backport minitest 5 to 4-0-stable

This pull request backports minitest 5 to 4-0-stable.