summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-28 22:59:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-28 22:59:41 +0900
commit2b77fbe1e01f563b5723f05c02c4c6d2701dd2c8 (patch)
tree8ffbadfaf750b9c013b5c3bbc4bdf072b42a26bd /test/t
parent03fa45760e2da4c09acb725fdca20f4e8f7adb27 (diff)
parentf0dd4cb673e5a6746f2726a88a6f45e29e530718 (diff)
downloadmruby-2b77fbe1e01f563b5723f05c02c4c6d2701dd2c8.tar.gz
mruby-2b77fbe1e01f563b5723f05c02c4c6d2701dd2c8.zip
Merge pull request #1967 from ksss/define_singleton_method
Implement Kernel#define_singleton_method
Diffstat (limited to 'test/t')
-rw-r--r--test/t/kernel.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index c8913c718..c6b65ddf7 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -542,6 +542,15 @@ assert('Kernel#__method__') do
assert_equal(:m2, c.new.m2)
end
+assert('Kernel#define_singleton_method') do
+ o = Object.new
+ ret = o.define_singleton_method(:test_method) do
+ :singleton_method_ok
+ end
+ assert_equal :test_method, ret
+ assert_equal :singleton_method_ok, o.test_method
+end
+
assert('stack extend') do
def recurse(count, stop)
return count if count > stop