Skip to content

Commit a3f4668

Browse files
committed
Adapt test in case erlang docs are not compiled
1 parent adf45a8 commit a3f4668

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/mix/test/mix/tasks/help_test.exs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,20 @@ defmodule Mix.Tasks.HelpTest do
204204
end
205205

206206
test "help Erlang MODULE", context do
207+
otp_docs? = match?({:docs_v1, _, _, _, _, _, _}, Code.fetch_docs(:math))
208+
207209
in_tmp(context.test, fn ->
208210
output =
209211
capture_io(fn ->
210212
Mix.Tasks.Help.run([":math"])
211213
end)
212214

213-
assert output =~ "This module provides an interface to a number of mathematical functions."
215+
if otp_docs? do
216+
assert output =~
217+
"This module provides an interface to a number of mathematical functions."
218+
else
219+
assert output =~ ":math was not compiled with docs"
220+
end
214221
end)
215222
end
216223

0 commit comments

Comments
 (0)