summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_exception.rb18
-rw-r--r--test/psych/test_psych.rb8
-rw-r--r--test/psych/test_safe_load.rb44
3 files changed, 2 insertions, 68 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index d2ae76a7d20..c1e69ab18d7 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -53,12 +53,6 @@ module Psych
Psych.load '--- `', filename: 'meow'
end
assert_equal 'meow', ex.file
-
- # deprecated interface
- ex = assert_raise(Psych::SyntaxError) do
- Psych.unsafe_load '--- `', 'deprecated'
- end
- assert_equal 'deprecated', ex.file
end
def test_psych_parse_stream_takes_file
@@ -86,12 +80,6 @@ module Psych
Psych.load_stream '--- `', filename: 'omg!'
end
assert_equal 'omg!', ex.file
-
- # deprecated interface
- ex = assert_raise(Psych::SyntaxError) do
- Psych.load_stream '--- `', 'deprecated'
- end
- assert_equal 'deprecated', ex.file
end
def test_parse_file_exception
@@ -141,12 +129,6 @@ module Psych
Psych.parse '--- `', filename: 'omg!'
end
assert_match 'omg!', ex.message
-
- # deprecated interface
- ex = assert_raise(Psych::SyntaxError) do
- Psych.parse '--- `', 'deprecated'
- end
- assert_match 'deprecated', ex.message
end
def test_attributes
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 912bcb9a78d..256ed9110cf 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -78,10 +78,6 @@ class TestPsych < Psych::TestCase
assert_raise(Psych::SyntaxError) { Psych.parse("--- `") }
end
- def test_parse_with_fallback
- assert_equal 42, Psych.parse("", fallback: 42)
- end
-
def test_non_existing_class_on_deserialize
e = assert_raise(ArgumentError) do
Psych.unsafe_load("--- !ruby/object:NonExistent\nfoo: 1")
@@ -239,11 +235,11 @@ class TestPsych < Psych::TestCase
end
def test_load_with_fallback_for_nil
- assert_nil Psych.unsafe_load("--- null", "file", fallback: 42)
+ assert_nil Psych.unsafe_load("--- null", filename: "file", fallback: 42)
end
def test_load_with_fallback_for_false
- assert_equal false, Psych.unsafe_load("--- false", "file", fallback: 42)
+ assert_equal false, Psych.unsafe_load("--- false", filename: "file", fallback: 42)
end
def test_load_file
diff --git a/test/psych/test_safe_load.rb b/test/psych/test_safe_load.rb
index d13ce7c7224..b52d6048b30 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: []