@@ -241,7 +241,7 @@ defmodule Mix.Tasks.XrefTest do
241
241
File . write! ( "lib/a.ex" , contents )
242
242
243
243
assert capture_io ( :stderr , fn ->
244
- assert Mix.Task . run ( "xref" , [ "-- warnings" ] ) == :error
244
+ assert Mix.Task . run ( "xref" , [ "warnings" ] ) == :error
245
245
end ) == expected
246
246
end
247
247
end
@@ -251,7 +251,7 @@ defmodule Mix.Tasks.XrefTest do
251
251
File . write! ( "lib/a.ex" , contents )
252
252
253
253
assert capture_io ( :stderr , fn ->
254
- assert Mix.Task . run ( "xref" , [ "-- warnings" ] ) == :ok
254
+ assert Mix.Task . run ( "xref" , [ "warnings" ] ) == :ok
255
255
end ) == ""
256
256
end
257
257
end
@@ -274,7 +274,7 @@ defmodule Mix.Tasks.XrefTest do
274
274
File . write! ( "lib/a.ex" , contents )
275
275
276
276
assert capture_io ( fn ->
277
- assert Mix.Task . run ( "xref" , [ "-- unreachable" ] ) == :error
277
+ assert Mix.Task . run ( "xref" , [ "unreachable" ] ) == :error
278
278
end ) == expected
279
279
end
280
280
end
@@ -420,34 +420,32 @@ defmodule Mix.Tasks.XrefTest do
420
420
421
421
test "callers: no argument gives error" do
422
422
in_fixture "no_mixfile" , fn ->
423
- message =
424
- "Could not invoke task \" xref\" : 1 error found!\n " <>
425
- "--callers : Missing argument of type string"
423
+ message = "xref expects one of the following commands: warnings, unreachable, callers CALLEE"
426
424
427
425
assert_raise Mix.Error , message , fn ->
428
- assert Mix.Task . run ( "xref" , [ "-- callers" ] ) == :error
426
+ assert Mix.Task . run ( "xref" , [ "callers" ] ) == :error
429
427
end
430
428
end
431
429
end
432
430
433
431
test "callers: gives nice error for quotable but invalid callers spec" do
434
432
in_fixture "no_mixfile" , fn ->
435
433
message =
436
- "xref -- callers expects Module, Module.function, or Module.function/arity, got: Module.func(arg)"
434
+ "xref callers CALLEE expects Module, Module.function, or Module.function/arity, got: Module.func(arg)"
437
435
438
436
assert_raise Mix.Error , message , fn ->
439
- Mix.Task . run ( "xref" , [ "-- callers" , "Module.func(arg)" ] )
437
+ Mix.Task . run ( "xref" , [ "callers" , "Module.func(arg)" ] )
440
438
end
441
439
end
442
440
end
443
441
444
442
test "callers: gives nice error for unquotable callers spec" do
445
443
in_fixture "no_mixfile" , fn ->
446
444
message =
447
- "xref -- callers expects Module, Module.function, or Module.function/arity, got: %"
445
+ "xref callers CALLEE expects Module, Module.function, or Module.function/arity, got: %"
448
446
449
447
assert_raise Mix.Error , message , fn ->
450
- Mix.Task . run ( "xref" , [ "-- callers" , "%" ] )
448
+ Mix.Task . run ( "xref" , [ "callers" , "%" ] )
451
449
end
452
450
end
453
451
end
@@ -458,7 +456,7 @@ defmodule Mix.Tasks.XrefTest do
458
456
File . write! ( "lib/b.ex" , contents_b )
459
457
460
458
assert capture_io ( fn ->
461
- assert Mix.Task . run ( "xref" , [ "-- callers" , callee ] ) == :ok
459
+ assert Mix.Task . run ( "xref" , [ "callers" , callee ] ) == :ok
462
460
end ) == expected
463
461
end
464
462
end
0 commit comments