aboutsummaryrefslogtreecommitdiffstats
path: root/test/psych/test_psych.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-07 16:58:10 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-07 16:58:10 +0000
commitdb70e477d310d9daf8f22b009521fcd67fec0205 (patch)
tree73778b242ce07f61ed0861409e473888251b056f /test/psych/test_psych.rb
parentc5942b91a2812cae59878b5e0d4ecf7c0e41cfdc (diff)
downloadruby-db70e477d310d9daf8f22b009521fcd67fec0205.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.rb12
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