diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-07 16:58:10 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-07 16:58:10 +0000 |
commit | a34e45fd546ac30f254237ab743120372f76935f (patch) | |
tree | 73778b242ce07f61ed0861409e473888251b056f /test/psych/test_psych.rb | |
parent | 56367e25ee9ae99694a2e69f6c2de0dfa9956211 (diff) | |
download | ruby-a34e45fd546ac30f254237ab743120372f76935f.tar.gz |
* ext/psych/*: update psych to 2.0.16
* test/psych/*: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r-- | test/psych/test_psych.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 8054bd6234..05a93438bc 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -8,7 +8,17 @@ class TestPsych < Psych::TestCase Psych.domain_types.clear end - def test_line_width + def test_line_width_invalid + assert_raises(ArgumentError) { Psych.dump('x', { :line_width => -2 }) } + end + + def test_line_width_no_limit + data = { 'a' => 'a b' * 50} + expected = "---\na: #{'a b' * 50}\n" + assert_equal(expected, Psych.dump(data, { :line_width => -1 })) + end + + def test_line_width_limit yml = Psych.dump('123456 7', { :line_width => 5 }) assert_match(/^\s*7/, yml) end |