diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-11-17 21:16:03 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-11-17 21:16:03 -0800 |
commit | 44bfff0204555e6a9d8bd764d9ee68bb47e0bffd (patch) | |
tree | 725e07c29ec37e79eab643f3d9df254cb1bab9c3 /test | |
parent | 83ff66422fd23f883a90a65b25644267a27e25bf (diff) | |
download | psych-44bfff0204555e6a9d8bd764d9ee68bb47e0bffd.zip |
making more tests pass!
Diffstat (limited to 'test')
-rw-r--r-- | test/test_scalar_scanner.rb | 2 | ||||
-rw-r--r-- | test/visitors/test_to_ruby.rb | 4 | ||||
-rw-r--r-- | test/yaml/test_yaml.rb | 9 |
3 files changed, 7 insertions, 8 deletions
diff --git a/test/test_scalar_scanner.rb b/test/test_scalar_scanner.rb index 4e76082..31e3041 100644 --- a/test/test_scalar_scanner.rb +++ b/test/test_scalar_scanner.rb @@ -69,7 +69,5 @@ class TestScalarScanner < MiniTest::Unit::TestCase def test_scan_true ss = Psych::ScalarScanner.new('true') assert_equal [:BOOLEAN, true], ss.tokenize - ss = Psych::ScalarScanner.new('y') - assert_equal [:BOOLEAN, true], ss.tokenize end end diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb index dcd4738..e5d6c9d 100644 --- a/test/visitors/test_to_ruby.rb +++ b/test/visitors/test_to_ruby.rb @@ -224,7 +224,7 @@ description: # http://yaml.org/type/bool.html def test_boolean_true - %w{ y Y yes Yes YES true True TRUE on On ON }.each do |t| + %w{ yes Yes YES true True TRUE on On ON }.each do |t| i = Nodes::Scalar.new(t, nil, 'tag:yaml.org,2002:bool') assert_equal true, i.to_ruby assert_equal true, Nodes::Scalar.new(t).to_ruby @@ -233,7 +233,7 @@ description: # http://yaml.org/type/bool.html def test_boolean_false - %w{ n N no No NO false False FALSE off Off OFF }.each do |t| + %w{ no No NO false False FALSE off Off OFF }.each do |t| i = Nodes::Scalar.new(t, nil, 'tag:yaml.org,2002:bool') assert_equal false, i.to_ruby assert_equal false, Nodes::Scalar.new(t).to_ruby diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index b40279f..15b8ca3 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -797,16 +797,17 @@ EOY YAML.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc ) YAML.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc ) YAML.add_domain_type( "clarkevans.com,2002", 'graph/text', &one_shape_proc ) + # MODIFIED to remove invalid YAML assert_parse_only( [[{"radius"=>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"]], <<EOY -- !clarkevans.com,2002/graph/^shape - - !^circle +- !clarkevans.com,2002/graph/shape + - !/graph/circle center: &ORIGIN {x: 73, y: 129} radius: 7 - - !^line # !clarkevans.com,2002/graph/line + - !/graph/line # !clarkevans.com,2002/graph/line start: *ORIGIN finish: { x: 89, y: 102 } - - !^text + - !/graph/text start: *ORIGIN color: 0xFFEEBB value: Pretty vector drawing. |