Skip to content

Commit e8aa7a2

Browse files
committed
Test parsing of bulleted list in comment blocks
1 parent a92cbf8 commit e8aa7a2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/docurium_test.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,40 @@ def test_can_parse_function_cast_args
164164
assert_equal expect_comment.split("\n"), func[:comments].split("\n")
165165
end
166166

167+
def test_can_handle_bulleted_lists
168+
type = @data[:types].find {|name, data| name == 'git_repository_init_options' }
169+
refute_nil type
170+
expect_comment = <<-EOF
171+
<p>This contains extra options for <code>git_repository_init_ext</code> that enable
172+
additional initialization features. The fields are:</p>
173+
174+
<ul>
175+
<li>flags - Combination of GIT_REPOSITORY_INIT flags above.</li>
176+
<li>mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_...
177+
constants above, or to a custom value that you would like.</li>
178+
<li>workdir_path - The path to the working dir or NULL for default (i.e.
179+
repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH,
180+
IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not
181+
the &quot;natural&quot; working directory, a .git gitlink file will be
182+
created here linking to the repo_path.</li>
183+
<li>description - If set, this will be used to initialize the &quot;description&quot;
184+
file in the repository, instead of using the template content.</li>
185+
<li>template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set,
186+
this contains the path to use for the template directory. If
187+
this is NULL, the config or default directory options will be
188+
used instead.</li>
189+
<li>initial_head - The name of the head to point HEAD at. If NULL, then
190+
this will be treated as &quot;master&quot; and the HEAD ref will be set
191+
to &quot;refs/heads/master&quot;. If this begins with &quot;refs/&quot; it will be
192+
used verbatim; otherwise &quot;refs/heads/&quot; will be prefixed.</li>
193+
<li>origin_url - If this is non-NULL, then after the rest of the
194+
repository initialization is completed, an &quot;origin&quot; remote
195+
will be added pointing to this URL.</li>
196+
</ul>
197+
EOF
198+
assert_equal expect_comment, type[1][:comments]
199+
end
200+
167201
def test_can_get_the_full_description_from_multi_liners
168202
func = @data[:functions]['git_commit_create_o']
169203
desc = "<p>Create a new commit in the repository using <code>git_object</code>\n instances as parameters.</p>\n"

0 commit comments

Comments
 (0)