File tree Expand file tree Collapse file tree 2 files changed +14
-26
lines changed Expand file tree Collapse file tree 2 files changed +14
-26
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,7 @@ def setup options
20
20
end
21
21
22
22
def finish options
23
- ::YAML . dump @data , @out
24
-
25
- super
23
+ output ::YAML . dump ( @data )
26
24
end
27
25
28
26
public
Original file line number Diff line number Diff line change 1
1
require 'test/unit'
2
+ require 'yaml'
2
3
require 'coderay'
3
4
4
5
class DuoTest < Test ::Unit ::TestCase
@@ -17,29 +18,18 @@ def test_two_hash
17
18
18
19
def test_call
19
20
duo = CodeRay ::Duo [ :python => :yml ]
20
- assert_equal <<-'YAML' , duo . call ( 'def test: "pass"' )
21
- ---
22
- - - def
23
- - :keyword
24
- - - " "
25
- - :space
26
- - - test
27
- - :method
28
- - - ":"
29
- - :operator
30
- - - " "
31
- - :space
32
- - - :begin_group
33
- - :string
34
- - - "\""
35
- - :delimiter
36
- - - pass
37
- - :content
38
- - - "\""
39
- - :delimiter
40
- - - :end_group
41
- - :string
42
- YAML
21
+ yaml = [ [ "def" , :keyword ] ,
22
+ [ " " , :space ] ,
23
+ [ "test" , :method ] ,
24
+ [ ":" , :operator ] ,
25
+ [ " " , :space ] ,
26
+ [ :begin_group , :string ] ,
27
+ [ "\" " , :delimiter ] ,
28
+ [ "pass" , :content ] ,
29
+ [ "\" " , :delimiter ] ,
30
+ [ :end_group , :string ] ]
31
+
32
+ assert_equal yaml , YAML . load ( duo . call ( 'def test: "pass"' ) )
43
33
end
44
34
45
35
end
You can’t perform that action at this time.
0 commit comments