@@ -208,7 +208,7 @@ defmodule Igniter.Test do
208
208
flunk ( """
209
209
Expected to find `mix #{ task } #{ Enum . join ( argv , " " ) } ` in igniter tasks.
210
210
211
- Found tasks:
211
+ Found tasks:
212
212
213
213
#{ Enum . map_join ( igniter . tasks , "\n " , fn { task , argv } -> "- mix #{ task } #{ Enum . join ( argv ) } " end ) }
214
214
""" )
@@ -221,7 +221,13 @@ defmodule Igniter.Test do
221
221
222
222
defmacro assert_has_notice ( igniter , notice ) do
223
223
quote bind_quoted: [ igniter: igniter , notice: notice ] do
224
- if notice not in igniter . notices do
224
+ if ! Enum . any? ( igniter . notices , fn found_notice ->
225
+ if is_binary ( notice ) do
226
+ notice == found_notice
227
+ else
228
+ notice . ( found_notice )
229
+ end
230
+ end ) do
225
231
if Enum . empty? ( igniter . notices ) do
226
232
flunk ( """
227
233
Expected to find the following notice:
@@ -236,7 +242,7 @@ defmodule Igniter.Test do
236
242
237
243
#{ notice }
238
244
239
- Found notices:
245
+ Found notices:
240
246
241
247
#{ Enum . join ( igniter . notices , "\n \b " ) }
242
248
""" )
@@ -249,7 +255,13 @@ defmodule Igniter.Test do
249
255
250
256
defmacro assert_has_warning ( igniter , warning ) do
251
257
quote bind_quoted: [ igniter: igniter , warning: warning ] do
252
- if warning not in igniter . warnings do
258
+ if ! Enum . any? ( igniter . warnings , fn found_warning ->
259
+ if is_binary ( warning ) do
260
+ warning == found_warning
261
+ else
262
+ warning . ( found_warning )
263
+ end
264
+ end ) do
253
265
if Enum . empty? ( igniter . warnings ) do
254
266
flunk ( """
255
267
Expected to find the following warning:
@@ -264,7 +276,7 @@ defmodule Igniter.Test do
264
276
265
277
#{ warning }
266
278
267
- Found warnings:
279
+ Found warnings:
268
280
269
281
#{ Enum . join ( igniter . warnings , "\n \b " ) }
270
282
""" )
@@ -287,7 +299,13 @@ defmodule Igniter.Test do
287
299
[ ]
288
300
end
289
301
290
- if issue not in issues do
302
+ if ! Enum . any? ( igniter . issues , fn found_issue ->
303
+ if is_binary ( issue ) do
304
+ issue == found_issue
305
+ else
306
+ issue . ( found_issue )
307
+ end
308
+ end ) do
291
309
if Enum . empty? ( issues ) do
292
310
flunk ( """
293
311
Expected to find the following issue at path: #{ inspect ( path ) } }
@@ -302,14 +320,20 @@ defmodule Igniter.Test do
302
320
303
321
#{ issue }
304
322
305
- Found issue:
323
+ Found issue:
306
324
307
325
#{ Enum . join ( issues , "\n \b " ) }
308
326
""" )
309
327
end
310
328
end
311
329
else
312
- if issue not in igniter . issues do
330
+ if ! Enum . any? ( igniter . issues , fn found_issue ->
331
+ if is_binary ( issue ) do
332
+ issue == found_issue
333
+ else
334
+ issue . ( found_issue )
335
+ end
336
+ end ) do
313
337
if Enum . empty? ( igniter . issues ) do
314
338
flunk ( """
315
339
Expected to find the following issue:
@@ -324,7 +348,7 @@ defmodule Igniter.Test do
324
348
325
349
#{ issue }
326
350
327
- Found issues:
351
+ Found issues:
328
352
329
353
#{ Enum . join ( igniter . issues , "\n \b " ) }
330
354
""" )
0 commit comments