summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter McLain <peter.mclain@gemstone.com>2010-03-29 15:52:31 -0700
committerPeter McLain <peter.mclain@gemstone.com>2010-03-29 15:52:31 -0700
commitc5f84428d51d85cee7fffef90b21da162c5d2258 (patch)
treee8f3b308d6b2666780c1d1c73e5ea62666a73ab9 /test
parente67d46d87b5911d8e1a5cebbd9cbf37cca7b0a0f (diff)
downloadpsych-c5f84428d51d85cee7fffef90b21da162c5d2258.zip
Fix problem with empty and white-space only strings. Add test.
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index fce070f..88fe83c 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -66,4 +66,11 @@ class TestPsych < Psych::TestCase
assert_equal 'hello world', Psych.parse_file(name).transform
end
+
+ def test_degenerate_strings
+ assert_equal false, Psych.load(' ')
+ assert_equal false, Psych.parse(' ')
+ assert_equal false, Psych.load('')
+ assert_equal false, Psych.parse('')
+ end
end