diff options
author | Alexander Momchilov <[email protected]> | 2022-07-21 15:07:39 -0400 |
---|---|---|
committer | git <[email protected]> | 2022-08-09 01:32:47 +0900 |
commit | 54219ae8c46bc431782caf01142883ce7e8b970b (patch) | |
tree | 8f0cecd389935d48f3214d0ded8fb46951015562 /test/psych/helper.rb | |
parent | 71f89c287459d5ca313d0b1a16b7a743e0d71b8b (diff) |
[ruby/psych] Raise specific error when aliases are not enabled
https://github.com/ruby/psych/commit/0c11ddcf46
Diffstat (limited to 'test/psych/helper.rb')
-rw-r--r-- | test/psych/helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/psych/helper.rb b/test/psych/helper.rb index 0643139d8c..4e82887c6d 100644 --- a/test/psych/helper.rb +++ b/test/psych/helper.rb @@ -51,7 +51,7 @@ module Psych :UseVersion => true, :UseHeader => true, :SortKeys => true ) )) - rescue Psych::DisallowedClass, Psych::BadAlias + rescue Psych::DisallowedClass, Psych::BadAlias, Psych::AliasesNotEnabled assert_to_yaml obj, yaml, :unsafe_load end @@ -61,7 +61,7 @@ module Psych def assert_parse_only( obj, yaml ) begin assert_equal obj, Psych::load( yaml ) - rescue Psych::DisallowedClass, Psych::BadAlias + rescue Psych::DisallowedClass, Psych::BadAlias, Psych::AliasesNotEnabled assert_equal obj, Psych::unsafe_load( yaml ) end assert_equal obj, Psych::parse( yaml ).transform @@ -79,7 +79,7 @@ module Psych assert_equal(obj, Psych.load(v.tree.yaml)) assert_equal(obj, Psych::load(Psych.dump(obj))) assert_equal(obj, Psych::load(obj.to_yaml)) - rescue Psych::DisallowedClass, Psych::BadAlias + rescue Psych::DisallowedClass, Psych::BadAlias, Psych::AliasesNotEnabled assert_equal(obj, Psych.unsafe_load(v.tree.yaml)) assert_equal(obj, Psych::unsafe_load(Psych.dump(obj))) assert_equal(obj, Psych::unsafe_load(obj.to_yaml)) |