summaryrefslogtreecommitdiff
path: root/test/unit/duo.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2011-08-20 17:09:50 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2011-08-20 17:09:50 +0200
commit0c9418057607d6aaf11754978662dfb60b3865fa (patch)
tree558b8ce33309de9ef28ad901459d96ddf1c46bf5 /test/unit/duo.rb
parentc073e4d256354d0d25fa65d1bfb0ab754198ff0a (diff)
downloadcoderay-0c9418057607d6aaf11754978662dfb60b3865fa.tar.gz
cleanup CodeRay.scan* methods
Diffstat (limited to 'test/unit/duo.rb')
-rw-r--r--test/unit/duo.rb28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/unit/duo.rb b/test/unit/duo.rb
index e7f3f91..62bd57b 100644
--- a/test/unit/duo.rb
+++ b/test/unit/duo.rb
@@ -16,10 +16,30 @@ class DuoTest < Test::Unit::TestCase
end
def test_call
- duo = CodeRay::Duo[:python => :xml]
- assert_equal <<-'XML'.chomp, duo.call('def test: "pass"')
-<?xml version='1.0'?><coderay-tokens><keyword>def</keyword> <method>test</method><operator>:</operator> <string><delimiter>&quot;</delimiter><content>pass</content><delimiter>&quot;</delimiter></string></coderay-tokens>
- XML
+ duo = CodeRay::Duo[:python => :yml]
+ assert_equal <<-'YAML', duo.call('def test: "pass"')
+---
+- - def
+ - :keyword
+- - " "
+ - :space
+- - test
+ - :method
+- - ":"
+ - :operator
+- - " "
+ - :space
+- - :begin_group
+ - :string
+- - "\""
+ - :delimiter
+- - pass
+ - :content
+- - "\""
+ - :delimiter
+- - :end_group
+ - :string
+ YAML
end
end