Use NameError#name to assert raised error.

This makes the test compatible with other Ruby implementations, which
may implement error messages differently.