diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-07 23:18:27 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-07 23:18:27 +0000 |
commit | 646b6995362aff14abfc08db24d091d01f5879d0 (patch) | |
tree | 43f1a48002803da9017b4de247c6fb7d23238a59 /test/psych | |
parent | 3a185ede69ac5845aebbde38dc8e6fbe4f64308a (diff) |
* 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
Diffstat (limited to 'test/psych')
-rw-r--r-- | test/psych/test_psych.rb | 20 |
1 files changed, 20 insertions, 0 deletions
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 |