summaryrefslogtreecommitdiff
path: root/test/psych/test_safe_load.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-05-11 13:49:20 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-17 11:20:46 +0900
commit42b20bdbfe770053e02948e9577bdd412a8c98cf (patch)
treefcefb4937d0e282f02bddfa2cbc46ab112463140 /test/psych/test_safe_load.rb
parentb0e21197ceb5329f751c421510048055d3c2af57 (diff)
[ruby/psych] remove deprecated interface
https://github.com/ruby/psych/commit/0767227051
Diffstat (limited to 'test/psych/test_safe_load.rb')
-rw-r--r--test/psych/test_safe_load.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/test/psych/test_safe_load.rb b/test/psych/test_safe_load.rb
index d13ce7c..b52d604 100644
--- a/test/psych/test_safe_load.rb
+++ b/test/psych/test_safe_load.rb
@@ -31,8 +31,6 @@ module Psych
x = []
x << x
assert_equal(x, Psych.safe_load(Psych.dump(x), permitted_classes: [], permitted_symbols: [], aliases: true))
- # deprecated interface
- assert_equal(x, Psych.safe_load(Psych.dump(x), [], [], true))
end
def test_permitted_symbol
@@ -48,9 +46,6 @@ module Psych
permitted_symbols: [:foo]
)
)
-
- # deprecated interface
- assert_equal(:foo, Psych.safe_load(yml, [Symbol], [:foo]))
end
def test_symbol
@@ -61,17 +56,9 @@ module Psych
Psych.safe_load '--- !ruby/symbol foo', permitted_classes: []
end
- # deprecated interface
- assert_raise(Psych::DisallowedClass) do
- Psych.safe_load '--- !ruby/symbol foo', []
- end
-
assert_safe_cycle :foo, permitted_classes: [Symbol]
assert_safe_cycle :foo, permitted_classes: %w{ Symbol }
assert_equal :foo, Psych.safe_load('--- !ruby/symbol foo', permitted_classes: [Symbol])
-
- # deprecated interface
- assert_equal :foo, Psych.safe_load('--- !ruby/symbol foo', [Symbol])
end
def test_foo
@@ -79,18 +66,10 @@ module Psych
Psych.safe_load '--- !ruby/object:Foo {}', permitted_classes: [Foo]
end
- # deprecated interface
- assert_raise(Psych::DisallowedClass) do
- Psych.safe_load '--- !ruby/object:Foo {}', [Foo]
- end
-
assert_raise(Psych::DisallowedClass) do
assert_safe_cycle Foo.new
end
assert_kind_of(Foo, Psych.safe_load(Psych.dump(Foo.new), permitted_classes: [Foo]))
-
- # deprecated interface
- assert_kind_of(Foo, Psych.safe_load(Psych.dump(Foo.new), [Foo]))
end
X = Struct.new(:x)
@@ -122,27 +101,6 @@ module Psych
end
end
- def test_deprecated_anon_struct
- assert Psych.safe_load(<<-eoyml, [Struct, Symbol])
---- !ruby/struct
- foo: bar
- eoyml
-
- assert_raise(Psych::DisallowedClass) do
- Psych.safe_load(<<-eoyml, [Struct])
---- !ruby/struct
- foo: bar
- eoyml
- end
-
- assert_raise(Psych::DisallowedClass) do
- Psych.safe_load(<<-eoyml, [Symbol])
---- !ruby/struct
- foo: bar
- eoyml
- end
- end
-
def test_safe_load_default_fallback
assert_nil Psych.safe_load("")
end
@@ -159,8 +117,6 @@ module Psych
def cycle object, permitted_classes: []
Psych.safe_load(Psych.dump(object), permitted_classes: permitted_classes)
- # deprecated interface test
- Psych.safe_load(Psych.dump(object), permitted_classes)
end
def assert_safe_cycle object, permitted_classes: []