summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_class.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 407b0aa4b8..ca78473026 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -274,6 +274,14 @@ class TestClass < Test::Unit::TestCase
assert_raise(TypeError) { Class.allocate.superclass }
bug6863 = '[ruby-core:47148]'
assert_raise(TypeError, bug6863) { Class.new(Class.allocate) }
+
+ allocator = Class.instance_method(:allocate)
+ assert_raise_with_message(TypeError, /prohibited/) {
+ allocator.bind(Rational).call
+ }
+ assert_raise_with_message(TypeError, /prohibited/) {
+ allocator.bind_call(Rational)
+ }
end
def test_nonascii_name