diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-08 15:50:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-08 15:50:48 -0700 |
commit | 734a4046b5ac58a21559d43d7d44ddfa3a25cfa5 (patch) | |
tree | b259beddf61a6b71a1e244463618a39fdcc3548c /test/visitors/test_to_ruby.rb | |
parent | 190735daf6e8ace3f1e6fc7ccf91938e30e8040b (diff) | |
download | psych-734a4046b5ac58a21559d43d7d44ddfa3a25cfa5.zip |
supporting legacy structs
Diffstat (limited to 'test/visitors/test_to_ruby.rb')
-rw-r--r-- | test/visitors/test_to_ruby.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb index f992752..677b8f5 100644 --- a/test/visitors/test_to_ruby.rb +++ b/test/visitors/test_to_ruby.rb @@ -11,6 +11,14 @@ module Psych @visitor = ToRuby.new end + def test_legacy_struct + foo = Struct.new('Foo', :bar) + assert_equal foo.new('baz'), Psych.load(<<-eoyml) +!ruby/struct:Foo + bar: baz + eoyml + end + def test_binary gif = "GIF89a\f\x00\f\x00\x84\x00\x00\xFF\xFF\xF7\xF5\xF5\xEE\xE9\xE9\xE5fff\x00\x00\x00\xE7\xE7\xE7^^^\xF3\xF3\xED\x8E\x8E\x8E\xE0\xE0\xE0\x9F\x9F\x9F\x93\x93\x93\xA7\xA7\xA7\x9E\x9E\x9Eiiiccc\xA3\xA3\xA3\x84\x84\x84\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9\xFF\xFE\xF9!\xFE\x0EMade with GIMP\x00,\x00\x00\x00\x00\f\x00\f\x00\x00\x05, \x8E\x810\x9E\xE3@\x14\xE8i\x10\xC4\xD1\x8A\b\x1C\xCF\x80M$z\xEF\xFF0\x85p\xB8\xB01f\r\e\xCE\x01\xC3\x01\x1E\x10' \x82\n\x01\x00;" |