diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-26 23:40:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-26 23:40:46 -0700 |
commit | a59a8c0fc75f6c0339facdd90302eb352e9d8ea6 (patch) | |
tree | 3313403dcdaf32fef09c6116d4b626ae430b7fe3 /test | |
parent | fd76e1c22a0c4a639d10c458733dea7a46390492 (diff) | |
download | psych-a59a8c0fc75f6c0339facdd90302eb352e9d8ea6.zip |
supporting scalar tags
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_parser.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index 7d6335b..90c19b2 100644 --- a/test/psych/test_parser.rb +++ b/test/psych/test_parser.rb @@ -28,6 +28,11 @@ module Psych assert_called :scalar, ['foo'] end + def test_scalar_with_tag + @parser.parse("---\n!!str foo\n") + assert_called :scalar, ['tag:yaml.org,2002:str', 'foo'] + end + def test_alias @parser.parse(<<-eoyml) %YAML 1.1 @@ -75,8 +80,10 @@ module Psych def assert_called call, with = nil, parser = @parser if with - assert( - parser.handler.calls.any? { |x| x.compact == [call, with] }, + call = parser.handler.calls.find { |x| + x.first == call && x.last.compact == with + } + assert(call, "#{[call,with].inspect} not in #{parser.handler.calls.inspect}" ) else |