Skip to content

Commit dd2eac5

Browse files
committed
Add test_parse_statements_embdoc_in_document
1 parent ced2fa3 commit dd2eac5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/test_rdoc_parser_ruby.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,6 +2528,40 @@ def blah()
25282528
assert_equal markup_code, expected
25292529
end
25302530

2531+
def test_parse_statements_embdoc_in_document
2532+
@filename = 'file.rb'
2533+
util_parser <<RUBY
2534+
class Foo
2535+
# doc
2536+
#
2537+
# =begin
2538+
# test embdoc
2539+
# =end
2540+
#
2541+
def blah
2542+
end
2543+
end
2544+
RUBY
2545+
2546+
expected = <<EXPTECTED
2547+
<p>doc
2548+
2549+
<pre class="ruby"><span class="ruby-comment">=begin
2550+
test embdoc
2551+
=end</span>
2552+
</pre>
2553+
EXPTECTED
2554+
2555+
@parser.scan
2556+
2557+
foo = @top_level.classes.first
2558+
assert_equal 'Foo', foo.full_name
2559+
2560+
blah = foo.method_list.first
2561+
markup_comment = blah.search_record[6]
2562+
assert_equal markup_comment, expected
2563+
end
2564+
25312565
def test_parse_require_dynamic_string
25322566
content = <<-RUBY
25332567
prefix = 'path'

0 commit comments

Comments
 (0)