diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-26 03:08:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-26 03:08:41 +0000 |
commit | 22783fdbc5a5421b27a9707b9e681957f95aba67 (patch) | |
tree | 442e59d42812d6df8d4a2fb319c943efb9753215 /test | |
parent | 48cb94779364a5f0e81fba0a702845a0ba5815d6 (diff) | |
download | ruby-22783fdbc5a5421b27a9707b9e681957f95aba67.tar.gz |
test_complex.rb, test_rational.rb: revert some assertions
* test_complex.rb, test_rational.rb: revert some assertions, but just
assert that a frozen object cannot be modified with marshal_load.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_complex.rb | 7 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 6 |
2 files changed, 11 insertions, 2 deletions
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 |