Fixes to TestCaseTest.

Add coverage for https://github.com/rails/rails/pull/16426/files#discussion_r15977801