summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-26 21:38:06 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-26 21:38:06 -0700
commite2dc5ad3f9b8da92fce87d049d1a3681ba52adb8 (patch)
tree97f083e8266d46aac067434c35bf8c8e77bfb4e3 /test
parentdb8a622d4687954b67dc675158bac07ed5d57cfa (diff)
downloadpsych-e2dc5ad3f9b8da92fce87d049d1a3681ba52adb8.zip
tag directives supported
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_parser.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index 748d67b..4a12015 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -33,14 +33,22 @@ module Psych
assert_called :start_stream
end
- def test_start_document
+ def test_start_document_version
@parser.parse("%YAML 1.1\n---\n\"foo\"\n")
- assert_called :start_document, [[1,1]]
+ assert_called :start_document, [[1,1], []]
+ end
+
+ def test_start_document_tag
+ @parser.parse("%TAG !yaml! tag:yaml.org,2002\n---\n!yaml!str \"foo\"\n")
+ assert_called :start_document, [[], [['!yaml!', 'tag:yaml.org,2002']]]
end
def assert_called call, with = nil, parser = @parser
if with
- assert parser.handler.calls.any? { |x| x == [call, with] }
+ assert(
+ parser.handler.calls.any? { |x| x == [call, with] },
+ "#{[call,with].inspect} not in #{parser.handler.calls.inspect}"
+ )
else
assert parser.handler.calls.any? { |x| x.first == call }
end