diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index adf4a01b2d..332e026f0f 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -658,7 +658,12 @@ class Complex_Test < Test::Unit::TestCase end bug3656 = '[ruby-core:31622]' - assert_not_respond_to(Complex(1,2), :marshal_load, bug3656) + c = Complex(1,2) + c.freeze + assert(c.frozen?) + result = c.marshal_load([2,3]) rescue :fail + assert_equal(:fail, result, bug3656) + assert_equal(Complex(1,2), c) end def test_marshal_compatibility diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index cc5ca9a750..208099a4ab 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -828,7 +828,11 @@ class Rational_Test < Test::Unit::TestCase } bug3656 = '[ruby-core:31622]' - assert_not_respond_to(Rational(1,2), :marshal_load, bug3656) + c = Rational(1,2) + c.freeze + assert(c.frozen?) + result = c.marshal_load([2,3]) rescue :fail + assert_equal(:fail, result, bug3656) end def test_marshal_compatibility