summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-04-05 19:03:46 +0900
committerKOBAYASHI Shuji <[email protected]>2019-04-05 19:03:46 +0900
commit623e15936a6c8b8ecaf9dca341be80c9316fd8be (patch)
tree9eb353fcbfe6db0f7ef4d31e2373fa5c99c1107c /test
parentf882b6908e4ac73a2fd59c0297c7f62e9bd01af5 (diff)
downloadmruby-623e15936a6c8b8ecaf9dca341be80c9316fd8be.tar.gz
mruby-623e15936a6c8b8ecaf9dca341be80c9316fd8be.zip
`Module#alias_method` should return `self` in ISO standard
Diffstat (limited to 'test')
-rw-r--r--test/t/module.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb
index ec36855e8..da0f78fad 100644
--- a/test/t/module.rb
+++ b/test/t/module.rb
@@ -25,6 +25,17 @@ assert('Module', '15.2.2') do
assert_equal Class, Module.class
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
assert('Module#ancestors', '15.2.2.4.9') do