File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,14 @@ def pop_token
105
105
# Current token stream
106
106
107
107
def token_stream
108
- @token_stream || [ ]
108
+ @token_stream
109
109
end
110
110
111
111
##
112
112
# Returns a string representation of the token stream
113
113
114
114
def tokens_to_s
115
- token_stream . compact . map { |token | token [ :text ] } . join ''
115
+ Array ( token_stream ) . compact . map { |token | token [ :text ] } . join ''
116
116
end
117
117
118
118
end
Original file line number Diff line number Diff line change @@ -39,6 +39,13 @@ def test_class_to_html_empty
39
39
assert_equal '' , RDoc ::TokenStream . to_html ( [ ] )
40
40
end
41
41
42
+ def test_token_stream
43
+ foo = Class . new do
44
+ include RDoc ::TokenStream
45
+ end . new
46
+ assert_equal nil , foo . token_stream
47
+ end
48
+
42
49
def test_tokens_to_s
43
50
foo = Class . new do
44
51
include RDoc ::TokenStream
You can’t perform that action at this time.
0 commit comments