Skip to content

Commit 5b08851

Browse files
committed
Mix.CLITest: explicitly declare environment variables (Windows-friendly)
1 parent bc0adc2 commit 5b08851

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/mix/test/mix/cli_test.exs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ defmodule Mix.CLITest do
1111
def project, do: [app: :p, version: "0.1.0"]
1212
end
1313
"""
14-
15-
output = System.cmd ~s(MIX_ENV=prod MIX_EXS=custom.exs #{elixir_executable} #{mix_executable}) <>
14+
15+
System.put_env("MIX_ENV", "prod")
16+
System.put_env("MIX_EXS", "custom.exs")
17+
18+
output = System.cmd ~s(#{elixir_executable} #{mix_executable}) <>
1619
~s( run -e "IO.inspect {Mix.env, System.argv}" -- 1 2 3)
17-
20+
21+
System.delete_env("MIX_ENV")
22+
System.delete_env("MIX_EXS")
23+
1824
assert output =~ ~s({:prod, ["1", "2", "3"]})
1925
assert output =~ "Compiled lib/a.ex"
2026
end

0 commit comments

Comments
 (0)