@@ -3,6 +3,7 @@ defmodule ExDoc.CLITest do
33 import ExUnit.CaptureIO
44
55 @ ebin "_build/test/lib/ex_doc/ebin"
6+ @ ebin2 "_build/test/lib/makeup/ebin"
67
78 defp run ( args ) do
89 with_io ( fn -> ExDoc.CLI . main ( args , & { & 1 , & 2 , & 3 } ) end )
@@ -17,7 +18,7 @@ defmodule ExDoc.CLITest do
1718 formatter: "html" ,
1819 formatters: [ "html" , "epub" ] ,
1920 apps: [ :ex_doc ] ,
20- source_beam: @ ebin
21+ source_beam: [ @ ebin ]
2122 ] }
2223
2324 assert epub ==
@@ -26,7 +27,7 @@ defmodule ExDoc.CLITest do
2627 formatter: "epub" ,
2728 formatters: [ "html" , "epub" ] ,
2829 apps: [ :ex_doc ] ,
29- source_beam: @ ebin
30+ source_beam: [ @ ebin ]
3031 ] }
3132 end
3233
@@ -39,7 +40,7 @@ defmodule ExDoc.CLITest do
3940 formatter: "epub" ,
4041 formatters: [ "epub" , "html" ] ,
4142 apps: [ :ex_doc ] ,
42- source_beam: @ ebin
43+ source_beam: [ @ ebin ]
4344 ] }
4445
4546 assert html ==
@@ -48,7 +49,7 @@ defmodule ExDoc.CLITest do
4849 formatter: "html" ,
4950 formatters: [ "epub" , "html" ] ,
5051 apps: [ :ex_doc ] ,
51- source_beam: @ ebin
52+ source_beam: [ @ ebin ]
5253 ] }
5354 end
5455
@@ -60,14 +61,18 @@ defmodule ExDoc.CLITest do
6061 assert io == "ExDoc v#{ ExDoc . version ( ) } \n "
6162 end
6263
63- test "too many arguments" do
64- assert catch_exit ( run ( [ "ExDoc" , "1.2.3" , "/" , "kaboom" ] ) ) == { :shutdown , 1 }
65- end
66-
6764 test "too few arguments" do
6865 assert catch_exit ( run ( [ "ExDoc" ] ) ) == { :shutdown , 1 }
6966 end
7067
68+ test "multiple apps" do
69+ { [ { "ExDoc" , "1.2.3" , html } , { "ExDoc" , "1.2.3" , epub } ] , _io } =
70+ run ( [ "ExDoc" , "1.2.3" , @ ebin , @ ebin2 ] )
71+
72+ assert [ :ex_doc , :makeup ] = Enum . sort ( Keyword . get ( html , :apps ) )
73+ assert [ :ex_doc , :makeup ] = Enum . sort ( Keyword . get ( epub , :apps ) )
74+ end
75+
7176 test "arguments that are not aliased" do
7277 File . write! ( "not_aliased.exs" , ~s( [key: "val"]) )
7378
@@ -98,7 +103,7 @@ defmodule ExDoc.CLITest do
98103 logo: "logo.png" ,
99104 main: "Main" ,
100105 output: "html" ,
101- source_beam: "#{ @ ebin } " ,
106+ source_beam: [ "#{ @ ebin } " ] ,
102107 source_ref: "abcdefg" ,
103108 source_url: "http://example.com/username/project"
104109 ]
@@ -127,7 +132,7 @@ defmodule ExDoc.CLITest do
127132 extras: [ "README.md" ] ,
128133 formatter: "html" ,
129134 formatters: [ "html" ] ,
130- source_beam: @ ebin
135+ source_beam: [ @ ebin ]
131136 ]
132137 after
133138 File . rm! ( "test.exs" )
@@ -155,7 +160,7 @@ defmodule ExDoc.CLITest do
155160 formatter: "html" ,
156161 formatters: [ "html" ] ,
157162 logo: "opts_logo.png" ,
158- source_beam: @ ebin
163+ source_beam: [ @ ebin ]
159164 ]
160165 after
161166 File . rm! ( "test.exs" )
@@ -192,7 +197,7 @@ defmodule ExDoc.CLITest do
192197 extras: [ "README.md" ] ,
193198 formatter: "html" ,
194199 formatters: [ "html" ] ,
195- source_beam: @ ebin
200+ source_beam: [ @ ebin ]
196201 ]
197202 after
198203 File . rm! ( "test.config" )
0 commit comments