   ## Only handling
 
   test "only extracts deps matching environment" do
-    with_deps [{:foo, github: "elixir-lang/foo"},
-               {:bar, github: "elixir-lang/bar", only: :other_env}], fn ->
-      in_fixture "deps_status", fn ->
-        deps = Mix.Dep.loaded([env: :other_env])
-        assert length(deps) == 2
-
-        deps = Mix.Dep.loaded([])
-        assert length(deps) == 2
-
-        assert [dep] = Mix.Dep.loaded([env: :prod])
-        assert dep.app == :foo
-      end
-    end
+    with_deps(
+      [{:foo, github: "elixir-lang/foo"}, {:bar, github: "elixir-lang/bar", only: :other_env}],
+      fn ->
+        in_fixture "deps_status", fn ->
+          deps = Mix.Dep.loaded(env: :other_env)
+          assert length(deps) == 2
+
+          deps = Mix.Dep.loaded([])
+          assert length(deps) == 2
+
+          assert [dep] = Mix.Dep.loaded(env: :prod)
+          assert dep.app == :foo
+        end
+      end
+    )
   end
 
   test "only fetches parent deps matching specified env" do
-    with_deps [{:only, github: "elixir-lang/only", only: [:dev]}], fn ->
+    with_deps([{:only, github: "elixir-lang/only", only: [:dev]}], fn ->
       in_fixture "deps_status", fn ->
         Mix.Tasks.Deps.Get.run(["--only", "prod"])
         refute_received {:mix_shell, :info, ["* Getting" <> _]}


        assert Process.get(:remote_converger)
      end
    end
  after
    Mix.RemoteConverger.register(nil)
  end

               deps: [{:git_repo, "0.1.0", git: MixTest.Case.fixture_path("git_repo")}]]
            end
          end
          """)

          Mix.ProjectStack.clear_cache()
          loaded = Mix.Dep.loaded([])
          assert [:git_repo, _, _] = Enum.map(loaded, & &1.app)
          hd(loaded).opts[:only]
        end
      end)
    end

    deps = [
      {:deps_repo, "0.1.0", path: "custom/deps_repo", only: :prod},
      {:other_repo, "0.1.0", path: "custom/other_repo", only: :test}
    ]

    assert loaded_only.(deps) == [:test, :prod]

    deps = [
      {:deps_repo, "0.1.0", path: "custom/deps_repo"},
      {:other_repo, "0.1.0", path: "custom/other_repo", only: :test}
    ]

    refute loaded_only.(deps)

    deps = [
      {:deps_repo, "0.1.0", path: "custom/deps_repo", only: :prod},
      {:other_repo, "0.1.0", path: "custom/other_repo"}
    ]

    refute loaded_only.(deps)

    deps = [
      {:deps_repo, "0.1.0", path: "custom/deps_repo"},
      {:other_repo, "0.1.0", path: "custom/other_repo"}
    ]

    refute loaded_only.(deps)

    Process.put(:custom_deps_git_repo_opts, optional: true)

    deps = [
      {:deps_repo, "0.1.0", path: "custom/deps_repo", only: :prod},
      {:other_repo, "0.1.0", path: "custom/other_repo", only: :test}
    ]

    assert loaded_only.(deps) == :test
  end
end
