Skip to content

Commit e34dcd8

Browse files
committed
Add test
1 parent 73ffff2 commit e34dcd8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,41 @@ defmodule Mix.Tasks.HelpTest do
222222
end)
223223
end
224224

225+
defmodule ExampleProject do
226+
def project do
227+
[
228+
app: :sample,
229+
version: "0.1.0"
230+
]
231+
end
232+
end
233+
234+
test "help app:APP for current project", context do
235+
in_tmp(context.test, fn ->
236+
Mix.Project.push(ExampleProject)
237+
File.mkdir_p!("lib")
238+
239+
File.write!("lib/example.ex", ~s'''
240+
defmodule Example do
241+
@moduledoc """
242+
This is an example module.
243+
"""
244+
end
245+
''')
246+
247+
output =
248+
capture_io(fn ->
249+
Mix.Tasks.Help.run(["app:sample"])
250+
end)
251+
252+
assert output =~ """
253+
# Example
254+
255+
This is an example module.
256+
"""
257+
end)
258+
end
259+
225260
test "help Elixir MODULE", context do
226261
in_tmp(context.test, fn ->
227262
output =

0 commit comments

Comments
 (0)