           ]
         end
       end
-      """
+      """)
 
       assert_raise Mix.Error, fn ->
-        Mix.Tasks.Deps.Get.run []
-        Mix.Tasks.Deps.Loadpaths.run []
-      end
-
-      assert_received {:mix_shell, :error, ["  the dependency git_repo in mix.exs is overriding" <> _]}
+        Mix.Tasks.Deps.Get.run([])
+        Mix.Tasks.Deps.Loadpaths.run([])
+      end
+
+      assert_received {:mix_shell, :error, [@overriding_msg <> _]}
     end
   end
 
   test "works with converged dependencies" do
-    Mix.Project.push ConvergedDepsApp
-
-    in_fixture "deps_status", fn ->
-      Mix.Tasks.Deps.Get.run []
+    Mix.Project.push(ConvergedDepsApp)
+
+    in_fixture "deps_status", fn ->
+      Mix.Tasks.Deps.Get.run([])
       message = "* Getting git_repo (#{fixture_path("git_repo")})"
       assert_received {:mix_shell, :info, [^message]}
 

Code.require_file "../../test_helper.exs", __DIR__

defmodule Mix.Tasks.DepsTest do
  use MixTest.Case

  defmodule DepsApp do
    def project do
      [app: :deps, version: "0.1.0",
       deps: [
         {:ok, "0.1.0",         github: "elixir-lang/ok"},
         {:invalidvsn, "0.2.0", path: "deps/invalidvsn"},
         {:invalidapp, "0.1.0", path: "deps/invalidapp"},
         {:noappfile, "0.1.0",  path: "deps/noappfile"},
         {:nosemver, "~> 0.1",  path: "deps/nosemver"},
       ]]
    end
  end

  defmodule SuccessfulDepsApp do
    def project do
      [app: :sample, version: "0.1.0",
       deps: [
         {:ok, "0.1.0", path: "deps/ok"}
       ]]
    end
  end

  defmodule ReqDepsApp do
    def project do
      [app: :req_deps, version: "0.1.0",
       deps: [
         {:ok, ">= 2.0.0",  path: "deps/ok"},
         {:noappfile,       path: "deps/noappfile", app: false},
         {:apppath,         path: "deps/noappfile", app: "../deps/ok/ebin/ok.app"}
       ]]
    end
  end

  ## deps

  test "prints list of dependencies and their status" do
    Mix.Project.push DepsApp

    in_fixture "deps_status", fn ->
      Mix.Tasks.Deps.run []

      assert_received {:mix_shell, :info, ["* ok (https://github.com/elixir-lang/ok.git) (mix)"]}
      assert_received {:mix_shell, :info, ["  the dependency is not available, run \"mix deps.get\""]}
      assert_received {:mix_shell, :info, ["* invalidvsn (deps/invalidvsn)"]}
      assert_received {:mix_shell, :info, ["  the app file contains an invalid version: :ok"]}
      assert_received {:mix_shell, :info, ["* invalidapp (deps/invalidapp) (mix)"]}
      assert_received {:mix_shell, :info, ["  the app file at \"_build/dev/lib/invalidapp/ebin/invalidapp.app\" is invalid"]}
      assert_received {:mix_shell, :info, ["* noappfile (deps/noappfile)"]}
      assert_received {:mix_shell, :info, ["  could not find an app file at \"_build/dev/lib/noappfile/ebin/noappfile.app\"" <> _]}
      assert_received {:mix_shell, :info, ["* nosemver (deps/nosemver)"]}
      assert_received {:mix_shell, :info, ["  the app file specified a non-Semantic Versioning format: \"0.7\"" <> _]}
    end
  end

  test "prints list of dependencies and their status, including req mismatches and custom apps" do
    Mix.Project.push ReqDepsApp

    in_fixture "deps_status", fn ->
      Mix.Tasks.Deps.run []

      assert_received {:mix_shell, :info, ["* ok (deps/ok) (mix)"]}
      assert_received {:mix_shell, :info, ["  the dependency does not match the requirement \">= 2.0.0\", got \"0.1.0\""]}
      assert_received {:mix_shell, :info, ["* noappfile (deps/noappfile)"]}
      assert_received {:mix_shell, :info, ["* apppath (deps/noappfile)"]}
      refute_received {:mix_shell, :info, ["  could not find app file at \"_build/dev/lib/noappfile/ebin/apppath.app\"" <> _]}
      refute_received {:mix_shell, :info, ["  could not find app file at \"_build/dev/lib/noappfile/ebin/noappfile.app\"" <> _]}
    end
  end

  test "prints Elixir req mismatches" do
    Mix.Project.push ReqDepsApp

    in_fixture "deps_status", fn ->
      File.write! "deps/ok/mix.exs", """
      defmodule Deps.OkApp do
        use Mix.Project


      # so the message appears just once
      refute_received {:mix_shell, :info, [^message]}

      Mix.Task.clear()
      Mix.Tasks.Deps.Update.run(["--all"])

      message = "* Updating git_repo (#{fixture_path("git_repo")})"
      assert_received {:mix_shell, :info, [^message]}
    end
  after
    purge([GitRepo, GitRepo.MixProject])
  end

  test "does not check dependencies if --no-deps-check is provided" do
    Mix.Project.push(SuccessfulDepsApp)

    in_fixture "deps_status", fn ->
      Mix.Tasks.Deps.Get.run([])
      File.rm_rf!("deps/ok")

      assert_raise Mix.Error, fn ->
        Mix.Tasks.Compile.run([])
      end

      Mix.Tasks.Compile.run(["--no-deps-check"])
    end
  end

  test "works with overridden dependencies" do
    Mix.Project.push(OverriddenDepsApp)

    in_fixture "deps_status", fn ->
      Mix.Tasks.Deps.Get.run([])
      message = "* Getting git_repo (#{fixture_path("git_repo")})"
      assert_received {:mix_shell, :info, [^message]}

