summaryrefslogtreecommitdiff
path: root/test/psych/test_safe_load.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_safe_load.rb')
-rw-r--r--test/psych/test_safe_load.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/psych/test_safe_load.rb b/test/psych/test_safe_load.rb
index f3fdb9b..cf8abeb 100644
--- a/test/psych/test_safe_load.rb
+++ b/test/psych/test_safe_load.rb
@@ -84,6 +84,18 @@ module Psych
end
end
+ def test_safe_load_default_fallback
+ assert_nil Psych.safe_load("")
+ end
+
+ def test_safe_load
+ assert_equal %w[a b], Psych.safe_load("- a\n- b")
+ end
+
+ def test_safe_load_raises_on_bad_input
+ assert_raises(Psych::SyntaxError) { Psych.safe_load("--- `") }
+ end
+
private
def cycle object, whitelist = []