Skip to content

Commit

Permalink
Add non umbrella test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed May 22, 2024
1 parent 007ccbb commit 3bc16a4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/hex/mix_task_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,19 @@ defmodule Hex.MixTaskTest do
end
end

defmodule EctoOverrideParent do
def project do
[
app: :ecto_override_parent,
version: "0.1.0",
consolidate_protocols: false,
deps: [
{:ecto_override, path: HexTest.Case.fixture_path("ecto_override")}
]
]
end
end

defp reset_code_paths(fun) do
path = :code.get_path()

Expand Down Expand Up @@ -1083,6 +1096,24 @@ defmodule Hex.MixTaskTest do
])
end

test "deps.get with path override" do
Mix.Project.push(EctoOverrideParent)

in_tmp(fn ->
Mix.Task.run("deps.get")

assert_received {:mix_shell, :info, ["* Getting postgrex (Hex package)"]}

assert %{
postgrex: {:hex, :postgrex, "0.2.0", _, _, _, _, _}
} = Mix.Dep.Lock.read()
end)
after
purge([
EctoOverride.Fixture.MixProject
])
end

test "deps.get umbrella with path override" do
in_fixture("umbrella_override", fn ->
Code.eval_file("mix.exs")
Expand Down

0 comments on commit 3bc16a4

Please sign in to comment.