`#determine_constant_from_test_name` does not swallow NoMethodErrors.

Closes #9933.

Since `NoMethodError` is a subclass of `NameError` determining
the constant from a test name silently swalled them.