>It checks that a local variable is not generated, which was clear in the message before.

I'm not sure about that, but all NameError subclasses (including NoMethodError) respond to `#name` (since 1.9), so this should be maintaining the original intention.
Could you give me more background about this test?