From db70e477d310d9daf8f22b009521fcd67fec0205 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Mon, 7 Dec 2015 16:58:10 +0000 Subject: * 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 --- test/psych/test_psych.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/psych/test_psych.rb') 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 -- cgit v1.2.3