Skip to content

Commit 6f88674

Browse files
author
Zachary Scott
committed
Adding test coverage for following RDoc::Task options:
* main * rdoc_dir * template * title
1 parent 62e256b commit 6f88674

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/test_rdoc_task.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ def test_generator_option
6464
assert_equal %w[-o html -f ri], rdoc_task.option_list
6565
end
6666

67+
def test_main_option
68+
rdoc_task = RDoc::Task.new do |rd|
69+
rd.main = "README.md"
70+
end
71+
72+
assert_equal %w[-o html --main README.md], rdoc_task.option_list
73+
end
74+
75+
def test_output_dir_option
76+
rdoc_task = RDoc::Task.new do |rd|
77+
rd.rdoc_dir = "zomg"
78+
end
79+
80+
assert_equal %w[-o zomg], rdoc_task.option_list
81+
end
82+
6783
def test_rdoc_task_description
6884
assert_equal 'Build RDoc HTML files', @t.rdoc_task_description
6985
end
@@ -116,5 +132,21 @@ def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option
116132
end
117133
end
118134

135+
def test_template_option
136+
rdoc_task = RDoc::Task.new do |rd|
137+
rd.template = "foo"
138+
end
139+
140+
assert_equal %w[-o html -T foo], rdoc_task.option_list
141+
end
142+
143+
def test_title_option
144+
rdoc_task = RDoc::Task.new do |rd|
145+
rd.title = "Test Title Option"
146+
end
147+
148+
assert_equal %w[-o html] << "--title" << "Test Title Option", rdoc_task.option_list
149+
end
150+
119151
end
120152

0 commit comments

Comments
 (0)