summaryrefslogtreecommitdiff
path: root/test/psych/test_psych.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-07 23:05:45 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-07 23:05:45 +0000
commit3a185ede69ac5845aebbde38dc8e6fbe4f64308a (patch)
treeccab9d64513867618fef559087c6c2fdcc8de72c /test/psych/test_psych.rb
parenta5d37d10a9e18952badcf821679104613590e779 (diff)
* ext/psych/lib/psych/visitors/emitter.rb: sending emit options to
YAML emitter. [ruby-core:28318] * ext/psych/emitter.c: updating documentation about emit options * ext/psych/lib/psych/core_ext.rb: ditto * ext/psych/lib/psych.rb (dump): passing emit options to emitter. * ext/psych/lib/psych/nodes/node.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r--test/psych/test_psych.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 0d33cb1..f3f3a53 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -8,6 +8,16 @@ class TestPsych < Psych::TestCase
Psych.domain_types.clear
end
+ def test_indent
+ yml = Psych.dump({:a => {'b' => 'c'}}, {:indentation => 5})
+ assert_match(/^[ ]{5}b/, yml)
+ end
+
+ def test_canonical
+ yml = Psych.dump({:a => {'b' => 'c'}}, {:canonical => true})
+ assert_match(/\? ! "b/, yml)
+ end
+
def test_load_argument_error
assert_raises(TypeError) do
Psych.load nil