@@ -27,7 +27,7 @@ defmodule Mix.Tasks.DepsTest do
27
27
end
28
28
end
29
29
30
- defmodule PerEnvironemtDepsApp do
30
+ defmodule PerEnvironmentDepsApp do
31
31
def project do
32
32
[ app: :sample , version: "0.1.0" , build_per_environment: true ,
33
33
deps: [
@@ -154,7 +154,7 @@ defmodule Mix.Tasks.DepsTest do
154
154
end
155
155
156
156
test "compiles and prunes builds per environment" do
157
- Mix.Project . push PerEnvironemtDepsApp
157
+ Mix.Project . push PerEnvironmentDepsApp
158
158
159
159
in_fixture "deps_status" , fn ->
160
160
Mix.Tasks.Deps.Compile . run [ ]
@@ -167,75 +167,14 @@ defmodule Mix.Tasks.DepsTest do
167
167
168
168
Mix.ProjectStack . post_config [ deps: [ ] ]
169
169
Mix.Project . pop
170
- Mix.Project . push PerEnvironemtDepsApp
170
+ Mix.Project . push PerEnvironmentDepsApp
171
171
172
172
Mix.Tasks.Deps.Check . run [ ]
173
173
refute File . exists? ( "_build/dev/lib/ok/ebin/ok.app" )
174
174
assert File . exists? ( "_build/dev/lib/sample/ebin/sample.app" )
175
175
end
176
176
end
177
177
178
- test "copies dev dependency when building per environment" do
179
- Mix.Project . push PerEnvironemtDepsApp
180
-
181
- in_fixture "deps_status" , fn ->
182
- File . mkdir_p! ( "deps/ok/lib" )
183
- File . write! ( "deps/ok/lib/empty.ex" , "" )
184
-
185
- Mix.Tasks.Deps.Compile . run [ ]
186
- assert File . exists? ( "_build/dev/lib/ok/ebin/ok.app" )
187
- assert_received { :mix_shell , :info , [ "Generated ok.app" ] }
188
-
189
- Mix.Task . clear
190
- Mix . env ( :test )
191
- Mix.Project . pop
192
- Mix.Project . push PerEnvironemtDepsApp
193
-
194
- Mix.Tasks.Deps.Compile . run [ ]
195
- assert File . exists? ( "_build/test/lib/ok/ebin/ok.app" )
196
- assert File . read! ( "_build/test/lib/ok/priv/sample" ) == "SAMPLE"
197
- # We don't get a message becaused we copied the contents over
198
- refute_received { :mix_shell , :info , [ "Generated ok.app" ] }
199
- end
200
- end
201
-
202
- test "does not choke when another environment is compiled first than dev" do
203
- Mix.Project . push PerEnvironemtDepsApp
204
- Mix . env ( :test )
205
-
206
- in_fixture "deps_status" , fn ->
207
- File . mkdir_p! ( "deps/ok/lib" )
208
- File . write! ( "deps/ok/lib/empty.ex" , "" )
209
-
210
- Mix.Tasks.Deps.Compile . run [ ]
211
- assert File . exists? ( "_build/test/lib/ok/ebin/ok.app" )
212
- assert File . read! ( "_build/test/lib/ok/priv/sample" ) == "SAMPLE"
213
- assert_received { :mix_shell , :info , [ "Generated ok.app" ] }
214
- end
215
- end
216
-
217
- test "does not copy if environments do not match" do
218
- Mix.ProjectStack . post_config ( deps: [ { :ok , "0.1.0" , path: "deps/ok" , env: Mix . env } ] )
219
- Mix.Project . push PerEnvironemtDepsApp
220
-
221
- in_fixture "deps_status" , fn ->
222
- File . mkdir_p! ( "deps/ok/lib" )
223
- File . write! ( "deps/ok/lib/empty.ex" , "" )
224
-
225
- Mix.Tasks.Deps.Compile . run [ ]
226
- assert File . exists? ( "_build/dev/lib/ok/ebin/ok.app" )
227
- assert_received { :mix_shell , :info , [ "Generated ok.app" ] }
228
-
229
- Mix.Task . clear
230
- Mix . env ( :test )
231
- Mix.Project . pop
232
- Mix.Project . push PerEnvironemtDepsApp
233
-
234
- Mix.Tasks.Deps.Compile . run [ ]
235
- assert_received { :mix_shell , :info , [ "Generated ok.app" ] }
236
- end
237
- end
238
-
239
178
test "unlocks all deps" do
240
179
Mix.Project . push DepsApp
241
180
in_fixture "no_mixfile" , fn ->
0 commit comments