@@ -110,6 +110,18 @@ defmodule Mix.ReleaseTest do
110
110
end
111
111
end
112
112
113
+ test "uses the latest version of an app if there are multiple versions" , context do
114
+ in_tmp ( context . test , fn ->
115
+ File . cp_r! ( :code . root_dir ( ) , "." , fn _ , _ -> false end )
116
+ File . mkdir_p! ( "lib/compiler-1.0" )
117
+ erts_source = Path . join ( File . cwd! ( ) , "erts-#{ @ erts_version } " )
118
+
119
+ release = from_config! ( nil , config ( releases: [ demo: [ include_erts: erts_source ] ] ) , [ ] )
120
+
121
+ assert release . applications . compiler [ :vsn ] != "1.0"
122
+ end )
123
+ end
124
+
113
125
test "raises on unknown app" do
114
126
assert_raise Mix.Error , "Could not find application :unknown" , fn ->
115
127
from_config! ( nil , config ( releases: [ demo: [ applications: [ unknown: :none ] ] ] ) , [ ] )
@@ -537,7 +549,7 @@ defmodule Mix.ReleaseTest do
537
549
assert File . exists? ( Path . join ( @ release_lib , "runtime_tools-#{ @ runtime_tools_version } /priv" ) )
538
550
end
539
551
540
- test "does not copy OTP app if include_erts is false" do
552
+ test "does not copy OTP app if include_erts is false" do
541
553
release = release ( include_erts: false , applications: [ runtime_tools: :permanent ] )
542
554
refute copy_app ( release , :runtime_tools )
543
555
refute File . exists? ( Path . join ( @ release_lib , "runtime_tools-#{ @ runtime_tools_version } /ebin" ) )
0 commit comments