summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
Diffstat (limited to 'test/t')
-rw-r--r--test/t/class.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb
index 7bcaaf90d..597999d3e 100644
--- a/test/t/class.rb
+++ b/test/t/class.rb
@@ -401,3 +401,12 @@ assert('class with non-class/module outer raises TypeError') do
assert_raise(TypeError) { class 0::C1; end }
assert_raise(TypeError) { class []::C2; end }
end
+
+assert("remove_method doesn't segfault if the passed in argument isn't a symbol") do
+ klass = Class.new
+ assert_raise(TypeError) { klass.remove_method nil }
+ assert_raise(TypeError) { klass.remove_method 123 }
+ assert_raise(TypeError) { klass.remove_method 1.23 }
+ assert_raise(NameError) { klass.remove_method "hello" }
+ assert_raise(TypeError) { klass.remove_method Class.new }
+end