Rely on NameError#name instead of its error message

Hello,

This pull request simply avoids assertions against error messages as they may change in the future and are different across implementations.

Have a nice day.