diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_numeric.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 7fbb8e955d..ecf5ebb32c 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -56,11 +56,20 @@ class TestNumeric < Test::Unit::TestCase end end - def test_numeric + def test_singleton_method a = Numeric.new assert_raise_with_message(TypeError, /foo/) { def a.foo; end } assert_raise_with_message(TypeError, /\u3042/) { eval("def a.\u3042; end") } + end + + def test_dup + a = Numeric.new assert_raise(TypeError) { a.dup } + + c = Module.new do + break eval("class C\u{3042} < Numeric; self; end") + end + assert_raise_with_message(TypeError, /C\u3042/) {c.new.dup} end def test_quo |