summaryrefslogtreecommitdiff
path: root/test/yaml
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-17 17:22:49 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-17 17:22:49 +0000
commitf3d9f34537779e2ed3d29519c6a29346b74409d7 (patch)
tree4998dbfa7c8cab36cc089090e0c9e0e0bd28030f /test/yaml
parent17f4f5f507715b8b832305f71b2375ca9f830ff4 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@9207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/yaml')
-rw-r--r--test/yaml/test_yaml.rb35
1 files changed, 13 insertions, 22 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index 05332a6..fd91fa8 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" } }, <<EOY
# 'http://domain.tld,2002/invoice' is some type family.
invoice: !domain.tld,2002/^invoice
@@ -744,9 +746,9 @@ EOY
end
def test_spec_explicit_families
- YAML.add_domain_type( "somewhere.com,2002", /^type$/ ) { |type, val|
- "SOMEWHERE: #{val}"
- }
+ YAML.add_domain_type( "somewhere.com,2002", 'type' ) { |type, val|
+ "SOMEWHERE: #{val}"
+ }
assert_parse_only(
{ 'not-date' => '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" }, <<EOY
not-date: !str 2002-04-28
@@ -1049,17 +1051,6 @@ EOY
)
end
- def test_perl_regexp
- # Parsing perl regular expressions from YAML.pm
- assert_parse_only(
- [ /bozo$/i ], <<EOY
-- !perl/regexp:
- regexp: bozo$
- mods: i
-EOY
- )
- end
-
#
# Test of Ranges
#