summaryrefslogtreecommitdiff
path: root/bootstraptest/test_method.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-24 09:45:25 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-24 09:45:25 +0000
commit145f0b0f507f4e1e88c20ae34f0252f94b9e2fe5 (patch)
tree99145ae85d074a6e12363c119123a09cf2949a49 /bootstraptest/test_method.rb
parenteb3f1f7aeb55778b13942b1823b460a15be693c5 (diff)
* bootstraptest/test_class.rb: new file.
* bootstraptest/test_method.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_method.rb')
-rw-r--r--bootstraptest/test_method.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index e1f6eab..e4f4a82 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -189,6 +189,33 @@ assert_equal '1', %q( class C
end
C.new.m )
+# undef
+assert_equal '1', %q( class C
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A
+ def m() end
+ end
+ class C < A
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.a; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.b; rescue NoMethodError; 1 end )
+
# private
assert_equal '1', %q( class C
def m() mm() end