From bef69a7275f44f35a63df597301846b3479593a4 Mon Sep 17 00:00:00 2001 From: why Date: Sat, 17 Sep 2005 17:17:07 +0000 Subject: * lib/yaml/rubytypes.rb: remove comments that are bungling up the rdoc and ri output. output symbols as plain scalars. * ext/syck/rubyext.c (syck_emitter_reset): emit headless documents always. * ext/syck/emitter.c (syck_scan_scalar): quote scalars with any kind of surrounding line space, tabs or spaces alike. * ext/syck/token.c: accept tabs as whitespace, not for indentation, but strip from plain scalars. * test/yaml/test_yaml.rb: remove outdated tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/yaml/test_yaml.rb | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'test') diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index 05332a6e4..fd91fa866 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -632,15 +632,17 @@ EOY end def test_spec_domain_prefix - YAML.add_domain_type( "domain.tld,2002", /(invoice|customer)/ ) { |type, val| - if Hash === val + customer_proc = proc { |type, val| + if Hash === val scheme, domain, type = type.split( ':', 3 ) - val['type'] = "domain #{type}" - val - else - raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect - end - } + val['type'] = "domain #{type}" + val + else + raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect + end + } + YAML.add_domain_type( "domain.tld,2002", 'invoice', &customer_proc ) + YAML.add_domain_type( "domain.tld,2002", 'customer', &customer_proc ) assert_parse_only( { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } }, < '2002-04-28', 'picture' => "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236i^\020' \202\n\001\000;", 'hmm' => "SOMEWHERE: family above is short for\nhttp://somewhere.com/type\n" }, <