From 646b6995362aff14abfc08db24d091d01f5879d0 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 7 Jul 2010 23:18:27 +0000 Subject: * ext/psych/lib/psych/visitors/yaml_tree.rb (push): adding version and header emit options. * test/psych/test_psych.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_psych.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/psych') diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index f3f3a531b3..42b30a0c97 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -18,6 +18,26 @@ class TestPsych < Psych::TestCase assert_match(/\? ! "b/, yml) end + def test_header + yml = Psych.dump({:a => {'b' => 'c'}}, {:header => true}) + assert_match(/YAML/, yml) + end + + def test_version_array + yml = Psych.dump({:a => {'b' => 'c'}}, {:version => [1,1]}) + assert_match(/1.1/, yml) + end + + def test_version_string + yml = Psych.dump({:a => {'b' => 'c'}}, {:version => '1.1'}) + assert_match(/1.1/, yml) + end + + def test_version_bool + yml = Psych.dump({:a => {'b' => 'c'}}, {:version => true}) + assert_match(/1.1/, yml) + end + def test_load_argument_error assert_raises(TypeError) do Psych.load nil -- cgit v1.2.3