summaryrefslogtreecommitdiffhomepage
path: root/test/t/kernel.rb
diff options
context:
space:
mode:
authorChristopher Aue <[email protected]>2017-08-11 13:12:06 +0200
committerChristopher Aue <[email protected]>2017-08-11 14:09:22 +0200
commit731dd78aa06e399497ddf9c54aea2e758b0f6b4b (patch)
tree35bed4c1f2671fd1e1e78020def07b90da922bdd /test/t/kernel.rb
parentd077a5f0a6a70a949a6129979b7ffcfbd269b636 (diff)
downloadmruby-731dd78aa06e399497ddf9c54aea2e758b0f6b4b.tar.gz
mruby-731dd78aa06e399497ddf9c54aea2e758b0f6b4b.zip
Added basic test for calling a missing method through super
Diffstat (limited to 'test/t/kernel.rb')
-rw-r--r--test/t/kernel.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index 40a3482f8..e9bd24dc3 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -359,6 +359,26 @@ assert('Kernel#method_missing', '15.3.1.3.30') do
mm_test = MMTestClass.new
assert_equal 'A call to no_method_named_this', mm_test.no_method_named_this
+ class SuperMMTestClass < MMTestClass
+ def no_super_method_named_this
+ super
+ end
+ end
+ super_mm_test = SuperMMTestClass.new
+ assert_equal 'A call to no_super_method_named_this', super_mm_test.no_super_method_named_this
+
+ class NoSuperMethodTestClass
+ def no_super_method_named_this
+ super
+ end
+ end
+ no_super_test = NoSuperMethodTestClass.new
+ begin
+ no_super_test.no_super_method_named_this
+ rescue NoMethodError => e
+ assert_equal "undefined method 'no_super_method_named_this' for #{no_super_test}", e.message
+ end
+
a = String.new
begin
a.no_method_named_this