Delete unused NameError#new. And add test.
Merge pull request #2223 from yui-knk/fix-nameerror

Delete unused NameError#new. And add test.