Commit 623e1593 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

`Module#alias_method` should return `self` in ISO standard

parent f882b690
...@@ -1843,7 +1843,7 @@ mrb_mod_alias(mrb_state *mrb, mrb_value mod) ...@@ -1843,7 +1843,7 @@ mrb_mod_alias(mrb_state *mrb, mrb_value mod)
mrb_get_args(mrb, "nn", &new_name, &old_name); mrb_get_args(mrb, "nn", &new_name, &old_name);
mrb_alias_method(mrb, c, new_name, old_name); mrb_alias_method(mrb, c, new_name, old_name);
return mrb_nil_value(); return mod;
} }
void void
......
...@@ -25,6 +25,17 @@ assert('Module', '15.2.2') do ...@@ -25,6 +25,17 @@ assert('Module', '15.2.2') do
assert_equal Class, Module.class assert_equal Class, Module.class
end end
assert('Module#alias_method', '15.2.2.4.8') do
cls = Class.new do
def foo
"FOO"
end
end
assert_same(cls, cls.alias_method(:bar, :foo))
assert_equal("FOO", cls.new.bar)
end
# TODO not implemented ATM assert('Module.constants', '15.2.2.3.1') do # TODO not implemented ATM assert('Module.constants', '15.2.2.3.1') do
assert('Module#ancestors', '15.2.2.4.9') do assert('Module#ancestors', '15.2.2.4.9') do
......
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