@@ -191,6 +191,52 @@ defmodule Mix.Tasks.HelpTest do
191191 end )
192192 end
193193
194+ test "help Elixir MODULE" , context do
195+ in_tmp ( context . test , fn ->
196+ output =
197+ capture_io ( fn ->
198+ Mix.Tasks.Help . run ( [ "Mix" ] )
199+ end )
200+
201+ assert output =~
202+ "Mix is a build tool that provides tasks for creating, compiling, and testing\n Elixir projects, managing its dependencies, and more."
203+ end )
204+ end
205+
206+ test "help Erlang MODULE" , context do
207+ in_tmp ( context . test , fn ->
208+ output =
209+ capture_io ( fn ->
210+ Mix.Tasks.Help . run ( [ ":math" ] )
211+ end )
212+
213+ assert output =~ "This module provides an interface to a number of mathematical functions."
214+ end )
215+ end
216+
217+ test "help FUNCTION/0" , context do
218+ in_tmp ( context . test , fn ->
219+ output =
220+ capture_io ( fn ->
221+ Mix.Tasks.Help . run ( [ "DateTime.utc_now()" ] )
222+ end )
223+
224+ assert output =~ "Returns the current datetime in UTC"
225+ end )
226+ end
227+
228+ test "help FUNCTION/1" , context do
229+ in_tmp ( context . test , fn ->
230+ output =
231+ capture_io ( fn ->
232+ Mix.Tasks.Help . run ( [ "Enum.all?/1" ] )
233+ end )
234+
235+ assert output =~
236+ "Returns \e [36mtrue\e [0m if all elements in \e [36menumerable\e [0m are truthy"
237+ end )
238+ end
239+
194240 test "help --search PATTERN" , context do
195241 in_tmp ( context . test , fn ->
196242 Mix.Tasks.Help . run ( [ "--search" , "deps" ] )
0 commit comments