|
1 | 1 | # frozen_string_literal: true
|
2 | 2 | require_relative 'helper'
|
3 | 3 |
|
4 |
| -class TestRDocGeneratorDarkfish < RDoc::TestCase |
| 4 | +class RDocGeneratorDarkfishTest < RDoc::TestCase |
5 | 5 |
|
6 | 6 | def setup
|
7 | 7 | super
|
@@ -367,6 +367,48 @@ def test_meta_tags_for_pages
|
367 | 367 | )
|
368 | 368 | end
|
369 | 369 |
|
| 370 | + def test_meta_tags_for_pages |
| 371 | + top_level = @store.add_file("MyPage", parser: RDoc::Parser::Simple) |
| 372 | + top_level.comment = RDoc::Markup::Document.new(RDoc::Markup::Paragraph.new('this is a comment')) |
| 373 | + |
| 374 | + @g.generate |
| 375 | + |
| 376 | + content = File.binread("MyPage.html") |
| 377 | + assert_include(content, '<meta name="keywords" content="ruby,documentation,MyPage">') |
| 378 | + assert_include( |
| 379 | + content, |
| 380 | + '<meta name="description" content="MyPage: this is a comment">', |
| 381 | + ) |
| 382 | + end |
| 383 | + |
| 384 | + def test_meta_tags_for_pages_with_non_text_parts |
| 385 | + top_level = @store.add_file("MyPage", parser: RDoc::Parser::Simple) |
| 386 | + top_level.comment = RDoc::Markup::Document.new(RDoc::Markup::BlankLine.new) |
| 387 | + |
| 388 | + @g.generate |
| 389 | + |
| 390 | + content = File.binread("MyPage.html") |
| 391 | + assert_include(content, '<meta name="keywords" content="ruby,documentation,MyPage">') |
| 392 | + assert_include( |
| 393 | + content, |
| 394 | + '<meta name="description" content="MyPage: ">', |
| 395 | + ) |
| 396 | + end |
| 397 | + |
| 398 | + def test_meta_tags_for_empty_document |
| 399 | + top_level = @store.add_file("MyPage", parser: RDoc::Parser::Simple) |
| 400 | + top_level.comment = RDoc::Markup::Document.new |
| 401 | + |
| 402 | + @g.generate |
| 403 | + |
| 404 | + content = File.binread("MyPage.html") |
| 405 | + assert_include(content, '<meta name="keywords" content="ruby,documentation,MyPage">') |
| 406 | + assert_include( |
| 407 | + content, |
| 408 | + '<meta name="description" content="MyPage: ">', |
| 409 | + ) |
| 410 | + end |
| 411 | + |
370 | 412 | ##
|
371 | 413 | # Asserts that +filename+ has a link count greater than 1 if hard links to
|
372 | 414 | # @tmpdir are supported.
|
|
0 commit comments