@@ -719,8 +719,8 @@ defmodule Mix.Tasks.TestTest do
719719 describe "--dry-run" do
720720 test "works with --stale" do
721721 in_fixture ( "test_stale" , fn ->
722- File . write! ( "test/dry_run_test_stale .exs" , """
723- defmodule DryRunTest do
722+ File . write! ( "test/dry_run_one_test_stale .exs" , """
723+ defmodule DryRunOneTest do
724724 use ExUnit.Case
725725
726726 test "new test" do
@@ -729,11 +729,25 @@ defmodule Mix.Tasks.TestTest do
729729 end
730730 """ )
731731
732+ File . write! ( "test/dry_run_two_test_stale.exs" , """
733+ defmodule DryRunTwoTest do
734+ use ExUnit.Case
735+
736+ @tag :skip
737+ test "skipped test" do
738+ assert true
739+ end
740+ end
741+ """ )
742+
732743 output = mix ( [ "test" , "--dry-run" , "--stale" ] )
733744
734- assert output =~ "Test dry run:"
735- assert output =~ "test/dry_run_test_stale.exs:4"
736- assert output =~ "0 tests, 0 failures (dry run)"
745+ assert output =~ "Tests that would be executed:"
746+ assert output =~ "test/a_test_stale.exs:4"
747+ assert output =~ "test/b_test_stale.exs:4"
748+ assert output =~ "test/dry_run_one_test_stale.exs:4"
749+ refute output =~ "test/dry_run_two_test_stale.exs:5"
750+ assert output =~ "1 test, 0 failures, 1 skipped"
737751 end )
738752 end
739753
@@ -742,9 +756,10 @@ defmodule Mix.Tasks.TestTest do
742756 _initial_run = mix ( [ "test" ] )
743757 output = mix ( [ "test" , "--dry-run" , "--failed" ] )
744758
745- assert output =~ "Test dry run:"
759+ assert output =~ "Tests that would be executed:"
760+ assert output =~ "test/only_failing_test_failed.exs:4"
746761 assert output =~ "test/passing_and_failing_test_failed.exs:5"
747- assert output =~ "0 tests, 0 failures (dry run) "
762+ assert output =~ "0 tests, 0 failures"
748763 end )
749764 end
750765 end
0 commit comments