Does not swallow NameError on determine_constant_from_test_name.

It is an attempt to fix #9933.

With this change, when a constant is not defined, it will raise `NameError`. Also I removed the tests that were expecting inexistent constant to return `nil`. 

I'm not sure if there was a reason not to raise `NameError`. Does it make sense?