Skip to content

Commit 004bfc4

Browse files
author
AtKaaZ
committed
fixing a test to also work in Windows
used to do this: 'MIX_ENV' is not recognized as an internal or external command, operable program or batch file. Tested to work on both Windows and Linux. However the following is seen on console: Mix requires the compile path "ebin" to be inside a directory with the same name as the application name :no_mixfile, got "s:/workspace.elixir.2013/elixir/lib/mix/tmp/Mix.CLITest/test env/ebin" quick test with `make test_mix`
1 parent 318716a commit 004bfc4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/mix/test/mix/cli_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ defmodule Mix.CLITest do
55

66
test "env" do
77
in_fixture "only_mixfile", fn ->
8-
env = System.cmd %b(MIX_ENV=prod #{elixir_executable} #{mix_executable} run "IO.puts Mix.env")
8+
if match? { :win32, _ }, :os.type do
9+
temp_env = "set MIX_ENV=prod &"
10+
else # ie. linux
11+
temp_env = "MIX_ENV=prod"
12+
end
13+
14+
env = System.cmd %b(#{temp_env} #{elixir_executable} #{mix_executable} run -e "IO.puts Mix.env")
915
assert env =~ "prod"
1016
end
1117
end

0 commit comments

Comments
 (0)