Commit adea2ca3 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2223 from yui-knk/fix-nameerror

Delete unused NameError#new. And add test.
parents e59c6a11 1a00a34c
......@@ -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