@@ -43,7 +43,7 @@ defmodule MixTest do
4343 assert Protocol . consolidated? ( InstallTest.Protocol )
4444
4545 assert_received { :mix_shell , :info , [ "==> install_test" ] }
46- assert_received { :mix_shell , :info , [ "Compiling 3 files (.ex)" ] }
46+ assert_received { :mix_shell , :info , [ "Compiling 2 files (.ex)" ] }
4747 assert_received { :mix_shell , :info , [ "Generated install_test app" ] }
4848 refute_received _
4949
@@ -71,7 +71,7 @@ defmodule MixTest do
7171
7272 assert File . dir? ( Path . join ( tmp_dir , "installs" ) )
7373 assert_received { :mix_shell , :info , [ "==> install_test" ] }
74- assert_received { :mix_shell , :info , [ "Compiling 3 files (.ex)" ] }
74+ assert_received { :mix_shell , :info , [ "Compiling 2 files (.ex)" ] }
7575 assert_received { :mix_shell , :info , [ "Generated install_test app" ] }
7676 refute_received _
7777
@@ -361,7 +361,7 @@ defmodule MixTest do
361361 ] )
362362
363363 assert_received { :mix_shell , :info , [ "==> install_test" ] }
364- assert_received { :mix_shell , :info , [ "Compiling 3 files (.ex)" ] }
364+ assert_received { :mix_shell , :info , [ "Compiling 2 files (.ex)" ] }
365365 assert_received { :mix_shell , :info , [ "Generated install_test app" ] }
366366 refute_received _
367367
@@ -431,6 +431,20 @@ defmodule MixTest do
431431 end
432432
433433 test "custom compilers" , % { tmp_dir: tmp_dir } do
434+ File . mkdir_p! ( "#{ tmp_dir } /install_test/lib/mix/tasks/compile/" )
435+
436+ File . write! ( "#{ tmp_dir } /install_test/lib/mix/tasks/compile/install_test.ex" , """
437+ defmodule Mix.Tasks.Compile.InstallTest do
438+ use Mix.Task.Compiler
439+
440+ def run(_args) do
441+ Mix.shell().info("Hello from custom compiler!")
442+
443+ :noop
444+ end
445+ end
446+ """ )
447+
434448 Mix . install (
435449 [
436450 { :install_test , path: Path . join ( tmp_dir , "install_test" ) }
@@ -493,7 +507,7 @@ defmodule MixTest do
493507 end )
494508 end
495509
496- defp test_project ( % { tmp_dir: tmp_dir } ) do
510+ defp test_project ( % { tmp_dir: tmp_dir } = context ) do
497511 path = :code . get_path ( )
498512
499513 on_exit ( fn ->
@@ -532,20 +546,6 @@ defmodule MixTest do
532546 end
533547 """ )
534548
535- File . mkdir_p! ( "#{ tmp_dir } /install_test/lib/mix/tasks/compile/" )
536-
537- File . write! ( "#{ tmp_dir } /install_test/lib/mix/tasks/compile/install_test.ex" , """
538- defmodule Mix.Tasks.Compile.InstallTest do
539- use Mix.Task.Compiler
540-
541- def run(_args) do
542- Mix.shell().info("Hello from custom compiler!")
543-
544- :noop
545- end
546- end
547- """ )
548-
549549 [ tmp_dir: tmp_dir ]
550550 end
551551
0 commit comments