Skip to content

Commit e29cdb7

Browse files
author
Zachary Scott
committed
Add test TestRDocTask#test_tasks_option_parser
This was added to verify options passing in RDoc::Task
1 parent 6f88674 commit e29cdb7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_rdoc_task.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ def test_tasks_creation_with_custom_name_symbol
5656
assert_equal :rdoc_dev, rd.name
5757
end
5858

59+
def test_tasks_option_parser
60+
rdoc_task = RDoc::Task.new do |rd|
61+
rd.title = "Test Tasks Option Parser"
62+
rd.main = "README.md"
63+
rd.rdoc_files.include("README.md")
64+
rd.options << "--all"
65+
end
66+
67+
assert rdoc_task.title, "Test Tasks Option Parser"
68+
assert rdoc_task.main, "README.md"
69+
assert rdoc_task.rdoc_files.include?("README.md")
70+
assert rdoc_task.options.include?("--all")
71+
72+
args = %w[--all -o html --main README.md] << "--title" << "Test Tasks Option Parser" << "README.md"
73+
assert_equal args, rdoc_task.option_list + rdoc_task.rdoc_files
74+
end
75+
5976
def test_generator_option
6077
rdoc_task = RDoc::Task.new do |rd|
6178
rd.generator = "ri"

0 commit comments

Comments
 (0)