From cf26b52ac6224b91ffc3fb63bb29fb4922ce47c5 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 21 Aug 2011 16:56:38 +0200 Subject: fix YAML encoder for Psych (damn!) --- test/unit/duo.rb | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'test/unit') 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 -- cgit v1.2.1