diff options
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r-- | test/psych/test_psych.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index b4c529c..bd271f2 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 |