Commit 1a00a34c authored by yui-knk's avatar yui-knk

Delete unused NameError#new. And add test.

parent e07a3731
......@@ -40,10 +40,6 @@ end
class NameError < StandardError
attr_accessor :name
def new(message="NameError", name=nil)
initialize(message, name)
end
def initialize(message=nil, name=nil)
@name = name
super(message)
......
......@@ -42,6 +42,16 @@ assert('Exception.exception', '15.2.22.4.1') do
assert_equal 'a', e.message
end
assert('NameError', '15.2.31') do
assert_raise(NameError) do
raise NameError.new
end
e = NameError.new "msg", "name"
assert_equal "msg", e.message
assert_equal "name", e.name
end
assert('ScriptError', '15.2.37') do
assert_raise(ScriptError) do
raise ScriptError.new
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment