Force use of minitest 4.x

Minitest 5 does not exist in ruby trunk.
Revert use of named captures in loop

This causes a warning due to reassigning a local variable (even though
it was previously created by a regexp).

See: https://bugs.ruby-lang.org/issues/9623