summaryrefslogtreecommitdiff
path: root/lib/mix/test/mix/dep_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mix/test/mix/dep_test.exs')
-rw-r--r--lib/mix/test/mix/dep_test.exs26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/mix/test/mix/dep_test.exs b/lib/mix/test/mix/dep_test.exs
index fbdb014ad..4cbba9cbb 100644
--- a/lib/mix/test/mix/dep_test.exs
+++ b/lib/mix/test/mix/dep_test.exs
@@ -752,11 +752,9 @@ defmodule Mix.DepTest do
test "converges and diverges when only is not specified" do
Process.put(:custom_deps_git_repo_opts, only: :test)
- # Pass nil environment to mimic behaviour in umbrellas
- # where the children are loaded without an environment.
deps = [
- {:abc_repo, "0.1.0", path: "custom/abc_repo", env: nil},
- {:deps_repo, "0.1.0", path: "custom/deps_repo", env: nil}
+ {:abc_repo, "0.1.0", path: "custom/abc_repo", from_umbrella: true},
+ {:deps_repo, "0.1.0", path: "custom/deps_repo", from_umbrella: true}
]
with_deps(deps, fn ->
@@ -847,5 +845,25 @@ defmodule Mix.DepTest do
end)
end)
end
+
+ test "considers only from current app on nested deps" do
+ Process.put(:custom_deps_git_repo_opts, only: :other)
+
+ deps = [
+ {:deps_repo, "0.1.0", path: "custom/deps_repo", from_umbrella: true},
+ {:git_repo, "0.1.0", git: MixTest.Case.fixture_path("git_repo"), from_umbrella: true}
+ ]
+
+ with_deps(deps, fn ->
+ in_fixture("deps_status", fn ->
+ Mix.Tasks.Deps.Compile.run([])
+
+ {:ok, [{:application, :deps_repo, opts}]} =
+ :file.consult("_build/dev/lib/deps_repo/ebin/deps_repo.app")
+
+ assert :git_repo not in Keyword.get(opts, :applications)
+ end)
+ end)
+ end
end
end