diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 17:16:29 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 17:16:29 -0700 |
commit | f9764c806980a663dbc75a8ec1764d02a225595d (patch) | |
tree | 6f08b36991fb1befeb1b0c950d13998b8661a677 /test | |
parent | 26eee0cd258ef47d595e9ae44e06ccf4d71ced56 (diff) | |
download | psych-f9764c806980a663dbc75a8ec1764d02a225595d.zip |
aliases can be emitted
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_emitter.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/visitors/test_emitter.rb b/test/visitors/test_emitter.rb index 6f19df9..e79a7b5 100644 --- a/test/visitors/test_emitter.rb +++ b/test/visitors/test_emitter.rb @@ -89,6 +89,21 @@ module Psych assert_match(/key: value/, @io.string) assert_equal @io.string, s.to_yaml end + + def test_alias + s = Nodes::Stream.new + doc = Nodes::Document.new + mapping = Nodes::Mapping.new + mapping.children << Nodes::Scalar.new('key', 'A') + mapping.children << Nodes::Alias.new('A') + doc.children << mapping + s.children << doc + + @visitor.accept s + + assert_match(/&A key: \*A/, @io.string) + assert_equal @io.string, s.to_yaml + end end end end |