summaryrefslogtreecommitdiff
path: root/test/psych
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-07 19:24:20 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-07 19:24:20 +0900
commitbb4a10208c8564a6c080a0de14ef6a5884c6173c (patch)
treed44d278114115b72de1e12a2aa9a953b13d668dd /test/psych
parentd7146dfd7dbe370ec9b7d6fde75bf1066bf7ed57 (diff)
Do not use YAML module in tests of Psych
Diffstat (limited to 'test/psych')
-rw-r--r--test/psych/test_psych.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index b4c529c5a7d..bd271f262a5 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -393,7 +393,7 @@ booleans:
- false
eoyml
- payload = YAML.safe_dump({
+ payload = Psych.safe_dump({
"array" => [1],
"float" => 13.12,
"booleans" => [true, false],
@@ -403,39 +403,39 @@ eoyml
def test_safe_dump_unpermitted_class
error = assert_raise Psych::DisallowedClass do
- YAML.safe_dump(Object.new)
+ Psych.safe_dump(Object.new)
end
assert_equal "Tried to dump unspecified class: Object", error.message
hash_subclass = Class.new(Hash)
error = assert_raise Psych::DisallowedClass do
- YAML.safe_dump(hash_subclass.new)
+ Psych.safe_dump(hash_subclass.new)
end
assert_equal "Tried to dump unspecified class: #{hash_subclass.inspect}", error.message
end
def test_safe_dump_extra_permitted_classes
- assert_equal "--- !ruby/object {}\n", YAML.safe_dump(Object.new, permitted_classes: [Object])
+ assert_equal "--- !ruby/object {}\n", Psych.safe_dump(Object.new, permitted_classes: [Object])
end
def test_safe_dump_symbols
error = assert_raise Psych::DisallowedClass do
- YAML.safe_dump(:foo, permitted_classes: [Symbol])
+ Psych.safe_dump(:foo, permitted_classes: [Symbol])
end
assert_equal "Tried to dump unspecified class: Symbol(:foo)", error.message
- assert_equal "--- :foo\n", YAML.safe_dump(:foo, permitted_classes: [Symbol], permitted_symbols: [:foo])
+ assert_equal "--- :foo\n", Psych.safe_dump(:foo, permitted_classes: [Symbol], permitted_symbols: [:foo])
end
def test_safe_dump_aliases
x = []
x << x
error = assert_raise Psych::BadAlias do
- YAML.safe_dump(x)
+ Psych.safe_dump(x)
end
assert_equal "Tried to dump an aliased object", error.message
- assert_equal "--- &1\n" + "- *1\n", YAML.safe_dump(x, aliases: true)
+ assert_equal "--- &1\n" + "- *1\n", Psych.safe_dump(x, aliases: true)
end
end