@@ -241,7 +241,7 @@ defmodule Mix.Tasks.XrefTest do
241241 File . write! ( "lib/a.ex" , contents )
242242
243243 assert capture_io ( :stderr , fn ->
244- assert Mix.Task . run ( "xref" , [ "-- warnings" ] ) == :error
244+ assert Mix.Task . run ( "xref" , [ "warnings" ] ) == :error
245245 end ) == expected
246246 end
247247 end
@@ -251,7 +251,7 @@ defmodule Mix.Tasks.XrefTest do
251251 File . write! ( "lib/a.ex" , contents )
252252
253253 assert capture_io ( :stderr , fn ->
254- assert Mix.Task . run ( "xref" , [ "-- warnings" ] ) == :ok
254+ assert Mix.Task . run ( "xref" , [ "warnings" ] ) == :ok
255255 end ) == ""
256256 end
257257 end
@@ -274,7 +274,7 @@ defmodule Mix.Tasks.XrefTest do
274274 File . write! ( "lib/a.ex" , contents )
275275
276276 assert capture_io ( fn ->
277- assert Mix.Task . run ( "xref" , [ "-- unreachable" ] ) == :error
277+ assert Mix.Task . run ( "xref" , [ "unreachable" ] ) == :error
278278 end ) == expected
279279 end
280280 end
@@ -420,34 +420,32 @@ defmodule Mix.Tasks.XrefTest do
420420
421421 test "callers: no argument gives error" do
422422 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"
426424
427425 assert_raise Mix.Error , message , fn ->
428- assert Mix.Task . run ( "xref" , [ "-- callers" ] ) == :error
426+ assert Mix.Task . run ( "xref" , [ "callers" ] ) == :error
429427 end
430428 end
431429 end
432430
433431 test "callers: gives nice error for quotable but invalid callers spec" do
434432 in_fixture "no_mixfile" , fn ->
435433 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)"
437435
438436 assert_raise Mix.Error , message , fn ->
439- Mix.Task . run ( "xref" , [ "-- callers" , "Module.func(arg)" ] )
437+ Mix.Task . run ( "xref" , [ "callers" , "Module.func(arg)" ] )
440438 end
441439 end
442440 end
443441
444442 test "callers: gives nice error for unquotable callers spec" do
445443 in_fixture "no_mixfile" , fn ->
446444 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: %"
448446
449447 assert_raise Mix.Error , message , fn ->
450- Mix.Task . run ( "xref" , [ "-- callers" , "%" ] )
448+ Mix.Task . run ( "xref" , [ "callers" , "%" ] )
451449 end
452450 end
453451 end
@@ -458,7 +456,7 @@ defmodule Mix.Tasks.XrefTest do
458456 File . write! ( "lib/b.ex" , contents_b )
459457
460458 assert capture_io ( fn ->
461- assert Mix.Task . run ( "xref" , [ "-- callers" , callee ] ) == :ok
459+ assert Mix.Task . run ( "xref" , [ "callers" , callee ] ) == :ok
462460 end ) == expected
463461 end
464462 end
0 commit comments