File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
require 'test/unit'
2
2
require 'ripper-tags/parser'
3
+ require 'pp'
3
4
4
5
class TagRipperTest < Test ::Unit ::TestCase
5
6
def extract ( code )
6
7
RipperTags ::Parser . extract ( code )
7
8
rescue
8
9
puts
9
- p Prism . parse ( code ) . value
10
+ if ENV [ "PRISM_VISITOR" ] || ENV [ "PRISM_WALK" ]
11
+ p Prism . parse ( code ) . value
12
+ else
13
+ pp Ripper . sexp ( code )
14
+ end
10
15
raise
11
16
end
12
17
@@ -97,15 +102,15 @@ def test_nested_constant_definitions
97
102
EOC
98
103
99
104
assert_equal %w[
100
- STATUSES
101
105
OPEN
102
- FROZEN_ARRAY
106
+ STATUSES
103
107
ARRAY_ENTRY
104
- DISPLAY_MAPPING
108
+ FROZEN_ARRAY
105
109
CANCELLED
106
110
STARTED
107
- FROZEN_HASH
111
+ DISPLAY_MAPPING
108
112
HASH_ENTRY
113
+ FROZEN_HASH
109
114
] , tags . map { |t | t [ :name ] }
110
115
111
116
tags . each do |t |
You can’t perform that action at this time.
0 commit comments