Skip to content

Commit 94993e0

Browse files
committed
Ensure fixtures are executed in archive test
Closes #11382.
1 parent 00a0f07 commit 94993e0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/mix/test/mix/tasks/archive_test.exs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,20 @@ defmodule Mix.Tasks.ArchiveTest do
149149
require Application
150150
true = Application.compile_env!(:git_repo, :archive_config)
151151
152-
defmodule GitRepo do
152+
defmodule GitRepo.Archive do
153153
def hello do
154154
"World"
155155
end
156156
end
157157
""")
158158

159+
System.cmd("git", ~w[init])
160+
System.cmd("git", ~w[add .])
161+
System.cmd("git", ~w[commit -m first-commit])
162+
159163
send(self(), {:mix_shell_input, :yes?, true})
160164
Mix.Tasks.Archive.Install.run(["git", File.cwd!()])
165+
assert GitRepo.Archive.hello() == "World"
161166

162167
message = "Generated archive \"git_repo-0.1.0.ez\" with MIX_ENV=prod"
163168
assert_received {:mix_shell, :info, [^message]}
@@ -166,7 +171,7 @@ defmodule Mix.Tasks.ArchiveTest do
166171
assert File.dir?(tmp_path("userhome/.mix/archives/git_repo-0.1.0/git_repo-0.1.0/ebin"))
167172
end)
168173
after
169-
purge([GitRepo, GitRepo.MixProject])
174+
purge([GitRepo.Archive, GitRepo.MixProject])
170175
end
171176

172177
test "archive install, update, and uninstall life-cycle" do

0 commit comments

Comments
 (0)