|
2 | 2 |
|
3 | 3 | require_relative 'helper' |
4 | 4 |
|
5 | | -class TestRDocMarkupPreProcess < RDoc::TestCase |
| 5 | +class RDoc::Markup::PreProcessTest < RDoc::TestCase |
6 | 6 |
|
7 | 7 | def setup |
8 | 8 | super |
@@ -85,18 +85,26 @@ def test_include_file_in_other_directory |
85 | 85 |
|
86 | 86 | def test_handle |
87 | 87 | text = "# :main: M\n" |
88 | | - out = @pp.handle text |
| 88 | + output = nil |
| 89 | + _, err = capture_output do |
| 90 | + output = @pp.handle text |
| 91 | + end |
89 | 92 |
|
90 | | - assert_equal "#\n", out |
| 93 | + assert_include err, "The :main: directive is deprecated and will be removed in RDoc 7." |
| 94 | + assert_equal "#\n", output |
91 | 95 | end |
92 | 96 |
|
93 | 97 | def test_handle_comment |
94 | 98 | text = "# :main: M\n" |
95 | 99 | c = comment text |
96 | 100 |
|
97 | | - out = @pp.handle c |
| 101 | + output = nil |
| 102 | + _, err = capture_output do |
| 103 | + output = @pp.handle c |
| 104 | + end |
98 | 105 |
|
99 | | - assert_equal "#\n", out |
| 106 | + assert_include err, "The :main: directive is deprecated and will be removed in RDoc 7." |
| 107 | + assert_equal "#\n", output |
100 | 108 | end |
101 | 109 |
|
102 | 110 | def test_handle_markup |
@@ -245,8 +253,11 @@ def test_handle_directive_include |
245 | 253 | def test_handle_directive_main |
246 | 254 | @pp.options = RDoc::Options.new |
247 | 255 |
|
248 | | - @pp.handle_directive '', 'main', 'M' |
| 256 | + _, err = capture_output do |
| 257 | + @pp.handle_directive '', 'main', 'M' |
| 258 | + end |
249 | 259 |
|
| 260 | + assert_include err, "The :main: directive is deprecated and will be removed in RDoc 7." |
250 | 261 | assert_equal 'M', @pp.options.main_page |
251 | 262 | end |
252 | 263 |
|
@@ -385,8 +396,11 @@ def test_handle_directive_stopdoc |
385 | 396 | def test_handle_directive_title |
386 | 397 | @pp.options = RDoc::Options.new |
387 | 398 |
|
388 | | - @pp.handle_directive '', 'title', 'T' |
| 399 | + _, err = capture_output do |
| 400 | + @pp.handle_directive '', 'title', 'T' |
| 401 | + end |
389 | 402 |
|
| 403 | + assert_include err, "The :title: directive is deprecated and will be removed in RDoc 7." |
390 | 404 | assert_equal 'T', @pp.options.title |
391 | 405 | end |
392 | 406 |
|
|
0 commit comments