@@ -8,6 +8,8 @@ defmodule Mix.Tasks.Compile.ElixirTest do
88 :ok
99 end
1010
11+ @ elixir_otp_version { System . version , :erlang . system_info ( :otp_release ) }
12+
1113 test "compiles a project without per environment build" do
1214 Mix.Project . pop
1315 Mix.ProjectStack . post_config [ build_per_environment: false ]
@@ -43,7 +45,7 @@ defmodule Mix.Tasks.Compile.ElixirTest do
4345
4446 assert File . exists? ( "_build/dev/lib/sample" )
4547 assert File . exists? ( "_build/dev/consolidated" )
46- assert Mix.Dep.ElixirSCM . read == { :ok , System . version , Mix.SCM.Path }
48+ assert Mix.Dep.ElixirSCM . read == { :ok , @ elixir_otp_version , Mix.SCM.Path }
4749
4850 Mix.Task . clear
4951 File . write! ( "_build/dev/consolidated/.to_be_removed" , "" )
@@ -52,7 +54,7 @@ defmodule Mix.Tasks.Compile.ElixirTest do
5254 File . touch! ( "_build/dev/lib/sample/.compile.elixir_scm" , { { 2010 , 1 , 1 } , { 0 , 0 , 0 } } )
5355
5456 Mix.Tasks.Compile . run [ ]
55- assert Mix.Dep.ElixirSCM . read == { :ok , System . version , Mix.SCM.Path }
57+ assert Mix.Dep.ElixirSCM . read == { :ok , @ elixir_otp_version , Mix.SCM.Path }
5658 assert File . stat! ( "_build/dev/lib/sample/.compile.elixir_scm" ) . mtime > { { 2010 , 1 , 1 } , { 0 , 0 , 0 } }
5759 refute File . exists? ( "_build/dev/consolidated/.to_be_removed" )
5860 end
@@ -64,15 +66,15 @@ defmodule Mix.Tasks.Compile.ElixirTest do
6466 purge [ A , B ]
6567
6668 assert_received { :mix_shell , :info , [ "Compiled lib/a.ex" ] }
67- assert Mix.Dep.ElixirSCM . read == { :ok , System . version , Mix.SCM.Path }
69+ assert Mix.Dep.ElixirSCM . read == { :ok , @ elixir_otp_version , Mix.SCM.Path }
6870
6971 Mix.Task . clear
70- manifest_data = :erlang . term_to_binary ( { :v1 , System . version , :another } )
72+ manifest_data = :erlang . term_to_binary ( { :v2 , @ elixir_otp_version , :another } )
7173 File . write! ( "_build/dev/lib/sample/.compile.elixir_scm" , manifest_data )
7274 File . touch! ( "_build/dev/lib/sample/.compile.elixir_scm" , { { 2010 , 1 , 1 } , { 0 , 0 , 0 } } )
7375
7476 Mix.Tasks.Compile . run [ ]
75- assert Mix.Dep.ElixirSCM . read == { :ok , System . version , Mix.SCM.Path }
77+ assert Mix.Dep.ElixirSCM . read == { :ok , @ elixir_otp_version , Mix.SCM.Path }
7678 assert File . stat! ( "_build/dev/lib/sample/.compile.elixir_scm" ) . mtime > { { 2010 , 1 , 1 } , { 0 , 0 , 0 } }
7779 end
7880 end
0 commit comments