diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-07 12:47:11 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-07 12:47:11 +0000 |
commit | 1380aa04a6c3681a232046058f4388f3bce904ae (patch) | |
tree | 9650337a0e4bcccb9a73cdc11e83bd6e3e42511e /test/date | |
parent | d59fc41fbaf6ae3458a5260fb53916468f7e56f7 (diff) | |
download | ruby-1380aa04a6c3681a232046058f4388f3bce904ae.tar.gz |
Support old versions of Ruby with FrozenError.
They should work separatedly from Ruby core repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date')
-rw-r--r-- | test/date/test_date_marshal.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/date/test_date_marshal.rb b/test/date/test_date_marshal.rb index 99a7239f95..24622bd4b9 100644 --- a/test/date/test_date_marshal.rb +++ b/test/date/test_date_marshal.rb @@ -30,13 +30,15 @@ class TestDateMarshal < Test::Unit::TestCase a = d.marshal_dump d.freeze assert(d.frozen?) - assert_raise(FrozenError){d.marshal_load(a)} + expected_error = defined?(FrozenError) ? FrozenError : RuntimeError + assert_raise(expected_error){d.marshal_load(a)} d = DateTime.now a = d.marshal_dump d.freeze assert(d.frozen?) - assert_raise(FrozenError){d.marshal_load(a)} + expected_error = defined?(FrozenError) ? FrozenError : RuntimeError + assert_raise(expected_error){d.marshal_load(a)} end end |