summaryrefslogtreecommitdiff
path: root/test/psych/test_deprecated.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-05-03 08:17:12 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-05-03 08:17:12 -0700
commit17b2deaa6e487e565d43c526a50d9974a54f5bbd (patch)
tree66e89731f4f0b70856adcb1d4abc7dbd9a14ae6f /test/psych/test_deprecated.rb
parent88bcb83729ebea6a7d4581b3100dfa7a783a9ff7 (diff)
downloadpsych-17b2deaa6e487e565d43c526a50d9974a54f5bbd.zip
merging from ruby
Diffstat (limited to 'test/psych/test_deprecated.rb')
-rw-r--r--test/psych/test_deprecated.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb
index 6db7238..a272db2 100644
--- a/test/psych/test_deprecated.rb
+++ b/test/psych/test_deprecated.rb
@@ -187,5 +187,24 @@ module Psych
assert_equal Psych, Psych.tagurize(Psych)
assert_equal 'tag:yaml.org,2002:foo', Psych.tagurize('foo')
end
+
+ def test_read_type_class
+ things = Psych.read_type_class 'tag:yaml.org,2002:int:Psych::TestDeprecated::QuickEmitter', Object
+ assert_equal 'int', things.first
+ assert_equal Psych::TestDeprecated::QuickEmitter, things.last
+ end
+
+ def test_read_type_class_no_class
+ things = Psych.read_type_class 'tag:yaml.org,2002:int', Object
+ assert_equal 'int', things.first
+ assert_equal Object, things.last
+ end
+
+ def test_object_maker
+ thing = Psych.object_maker(Object, { 'a' => 'b', 'c' => 'd' })
+ assert_instance_of(Object, thing)
+ assert_equal 'b', thing.instance_variable_get(:@a)
+ assert_equal 'd', thing.instance_variable_get(:@c)
+ end
end
end