summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2011-08-21 16:56:38 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2011-08-21 16:56:38 +0200
commitcf26b52ac6224b91ffc3fb63bb29fb4922ce47c5 (patch)
treecca5d73274a9604c91c818ea36298138a2a9e062 /test
parentfc509f3be65ff322ed460d4a5569952bb5973939 (diff)
downloadcoderay-cf26b52ac6224b91ffc3fb63bb29fb4922ce47c5.tar.gz
fix YAML encoder for Psych (damn!)
Diffstat (limited to 'test')
-rw-r--r--test/unit/duo.rb36
1 files changed, 13 insertions, 23 deletions
diff --git a/test/unit/duo.rb b/test/unit/duo.rb
index 62bd57b..05c26a5 100644
--- a/test/unit/duo.rb
+++ b/test/unit/duo.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'yaml'
require 'coderay'
class DuoTest < Test::Unit::TestCase
@@ -17,29 +18,18 @@ class DuoTest < Test::Unit::TestCase
def test_call
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
+ yaml = [["def", :keyword],
+ [" ", :space],
+ ["test", :method],
+ [":", :operator],
+ [" ", :space],
+ [:begin_group, :string],
+ ["\"", :delimiter],
+ ["pass", :content],
+ ["\"", :delimiter],
+ [:end_group, :string]]
+
+ assert_equal yaml, YAML.load(duo.call('def test: "pass"'))
end
end