diff --git a/test/psych/test_nil.rb b/test/psych/test_nil.rb index 910a2e697d..bcbbcb9c93 100644 --- a/test/psych/test_nil.rb +++ b/test/psych/test_nil.rb @@ -5,13 +5,13 @@ module Psych class TestNil < TestCase def test_nil yml = Psych.dump nil - assert_match(/--- \n(?:\.\.\.\n)?/, yml) + assert_match(/---[ ]?\n(?:\.\.\.\n)?/, yml) assert_nil Psych.load(yml) end def test_array_nil yml = Psych.dump [nil] - assert_equal "---\n- \n", yml + assert_match(/---\n-[ ]?\n/, yml) assert_equal [nil], Psych.load(yml) end diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 2812fd1bd8..9472d8ec37 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -121,17 +121,17 @@ class TestPsych < Psych::TestCase def test_domain_types got = nil - Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val| + Psych.add_domain_type 'foo.bar/2002', 'foo' do |type, val| got = val end - Psych.load('--- !foo.bar,2002/foo hello') + Psych.load('--- !foo.bar/2002:foo hello') assert_equal 'hello', got - Psych.load("--- !foo.bar,2002/foo\n- hello\n- world") + Psych.load("--- !foo.bar/2002:foo\n- hello\n- world") assert_equal %w{ hello world }, got - Psych.load("--- !foo.bar,2002/foo\nhello: world") + Psych.load("--- !foo.bar/2002:foo\nhello: world") assert_equal({ 'hello' => 'world' }, got) end @@ -170,16 +170,13 @@ class TestPsych < Psych::TestCase types = [] appender = lambda { |*args| types << args } - Psych.add_builtin_type('foo', &appender) - Psych.add_domain_type('example.com,2002', 'foo', &appender) + Psych.add_domain_type('example.com:2002', 'foo', &appender) Psych.load <<-eoyml -- !tag:yaml.org,2002:foo bar -- !tag:example.com,2002:foo bar +- !tag:example.com:2002:foo bar eoyml assert_equal [ - ["tag:yaml.org,2002:foo", "bar"], - ["tag:example.com,2002:foo", "bar"] + ["tag:example.com:2002:foo", "bar"] ], types end diff --git a/test/psych/test_yaml.rb b/test/psych/test_yaml.rb index 5fa759c981..0dfd60f894 100644 --- a/test/psych/test_yaml.rb +++ b/test/psych/test_yaml.rb @@ -617,11 +617,11 @@ EOY raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect end } - Psych.add_domain_type( "domain.tld,2002", 'invoice', &customer_proc ) - Psych.add_domain_type( "domain.tld,2002", 'customer', &customer_proc ) + Psych.add_domain_type( "domain.tld/2002", 'invoice', &customer_proc ) + Psych.add_domain_type( "domain.tld/2002", 'customer', &customer_proc ) assert_parse_only( { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } }, <7, "center"=>{"x"=>73, "y"=>129}, "TYPE"=>"Shape: graph/circle"}, {"finish"=>{"x"=>89, "y"=>102}, "TYPE"=>"Shape: graph/line", "start"=>{"x"=>73, "y"=>129}}, {"TYPE"=>"Shape: graph/text", "value"=>"Pretty vector drawing.", "start"=>{"x"=>73, "y"=>129}, "color"=>16772795}, "Shape Container"]], <