Skip to content

Commit ead41d2

Browse files
committed
Update test cases
1 parent 245194a commit ead41d2

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

test/rdoc/test_rdoc_markup_pre_process.rb

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_relative 'helper'
44

5-
class TestRDocMarkupPreProcess < RDoc::TestCase
5+
class RDoc::Markup::PreProcessTest < RDoc::TestCase
66

77
def setup
88
super
@@ -85,18 +85,26 @@ def test_include_file_in_other_directory
8585

8686
def test_handle
8787
text = "# :main: M\n"
88-
out = @pp.handle text
88+
output = nil
89+
_, err =capture_output do
90+
output = @pp.handle text
91+
end
8992

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
9195
end
9296

9397
def test_handle_comment
9498
text = "# :main: M\n"
9599
c = comment text
96100

97-
out = @pp.handle c
101+
output = nil
102+
_, err = capture_output do
103+
output = @pp.handle c
104+
end
98105

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
100108
end
101109

102110
def test_handle_markup
@@ -245,8 +253,11 @@ def test_handle_directive_include
245253
def test_handle_directive_main
246254
@pp.options = RDoc::Options.new
247255

248-
@pp.handle_directive '', 'main', 'M'
256+
_, err = capture_output do
257+
@pp.handle_directive '', 'main', 'M'
258+
end
249259

260+
assert_include err, "The :main: directive is deprecated and will be removed in RDoc 7."
250261
assert_equal 'M', @pp.options.main_page
251262
end
252263

@@ -385,8 +396,11 @@ def test_handle_directive_stopdoc
385396
def test_handle_directive_title
386397
@pp.options = RDoc::Options.new
387398

388-
@pp.handle_directive '', 'title', 'T'
399+
_, err = capture_output do
400+
@pp.handle_directive '', 'title', 'T'
401+
end
389402

403+
assert_include err, "The :title: directive is deprecated and will be removed in RDoc 7."
390404
assert_equal 'T', @pp.options.title
391405
end
392406

0 commit comments

Comments
 (0)