diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-03-22 09:54:27 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-03-22 09:54:27 -0700 |
commit | c908d22b6c9b502a99f7182d0a37952a4336e271 (patch) | |
tree | 869044a83eae01351be205cde15617b3e78e433e /test/test_psych.rb | |
parent | a086e89e5364c88350122c3608e1618b90d46b0d (diff) | |
download | psych-c908d22b6c9b502a99f7182d0a37952a4336e271.zip |
adding support for add_builtin_type. fixes GH #1
Diffstat (limited to 'test/test_psych.rb')
-rw-r--r-- | test/test_psych.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_psych.rb b/test/test_psych.rb index c01d539..f8700c8 100644 --- a/test/test_psych.rb +++ b/test/test_psych.rb @@ -20,6 +20,17 @@ class TestPsych < MiniTest::Unit::TestCase assert_equal %w{ foo bar }, docs end + def test_add_builtin_type + got = nil + Psych.add_builtin_type 'omap', do |type, val| + got = val + end + Psych.load('--- !omap hello') + assert_equal 'hello', got + ensure + Psych.remove_type 'omap' + end + def test_domain_types got = nil Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val| |