@@ -110,6 +110,18 @@ defmodule Mix.ReleaseTest do
110110 end
111111 end
112112
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+
113125 test "raises on unknown app" do
114126 assert_raise Mix.Error , "Could not find application :unknown" , fn ->
115127 from_config! ( nil , config ( releases: [ demo: [ applications: [ unknown: :none ] ] ] ) , [ ] )
@@ -537,7 +549,7 @@ defmodule Mix.ReleaseTest do
537549 assert File . exists? ( Path . join ( @ release_lib , "runtime_tools-#{ @ runtime_tools_version } /priv" ) )
538550 end
539551
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
541553 release = release ( include_erts: false , applications: [ runtime_tools: :permanent ] )
542554 refute copy_app ( release , :runtime_tools )
543555 refute File . exists? ( Path . join ( @ release_lib , "runtime_tools-#{ @ runtime_tools_version } /ebin" ) )
0 commit comments