       Mix.Task.run("invalid")
     end
 
-    misnamed_message =
+    message =
       "The task \"acronym.http\" could not be found because the module is named " <>
-      "Mix.Tasks.Acronym.HTTP instead of Mix.Tasks.Acronym.Http as expected. " <>
-      "Please rename it and try again"
-    assert_raise Mix.NoTaskError, misnamed_message, fn ->
+        "Mix.Tasks.Acronym.HTTP instead of Mix.Tasks.Acronym.Http as expected. " <>
+        "Please rename it and try again"
+
+    assert_raise Mix.NoTaskError, message, fn ->
       Mix.Task.run("acronym.http")
     end
   end
 
   test "run/2 converts OptionParser.ParseError into Mix errors" do
-    assert_raise Mix.Error,
-                 "Could not invoke task \"hello\": 1 error found!\n--unknown : Unknown option", fn ->
+    message = "Could not invoke task \"hello\": 1 error found!\n--unknown : Unknown option"
+
+    assert_raise Mix.Error, message, fn ->
       Mix.Task.run("hello", ["--parser", "--unknown"])
     end
 
-    Mix.Task.clear
-
-    assert_raise Mix.Error,
-                 "Could not invoke task \"hello\": 1 error found!\n--int : Expected type integer, got \"foo\"", fn ->
+    Mix.Task.clear()
+
+    message =
+      "Could not invoke task \"hello\": 1 error found!\n--int : Expected type integer, got \"foo\""
+
+    assert_raise Mix.Error, message, fn ->
       Mix.Task.run("hello", ["--parser", "--int", "foo"])
     end
   end
 
   test "run/2 outputs task debug info if Mix.debug? is true" do
-    Mix.shell Mix.Shell.IO
+    Mix.shell(Mix.Shell.IO)
     Mix.debug(true)
 
-    assert ExUnit.CaptureIO.capture_io(fn -> Mix.Task.run("hello") end) =~
-      "** Running mix hello"
+    assert ExUnit.CaptureIO.capture_io(fn -> Mix.Task.run("hello") end) =~ "** Running mix hello"
   after
     Mix.shell(Mix.Shell.Process)
     Mix.debug(false)

    assert Mix.Task.alias?(:sample) == false
    assert Mix.Task.alias?("sample") == false

    Mix.Project.push MixTest.Case.Sample
    assert Mix.Task.alias?(:sample) == true
    assert Mix.Task.alias?("sample") == true
    assert Mix.Task.alias?("another") == false
  after
    Mix.Project.pop
  end

  test "all_modules/0" do
    Mix.Task.load_all
    modules = Mix.Task.all_modules
    assert Mix.Tasks.Hello in modules
    assert Mix.Tasks.Compile in modules
  end

  test "moduledoc/1" do
    Code.prepend_path MixTest.Case.tmp_path("beams")
    assert Mix.Task.moduledoc(Mix.Tasks.Hello) == "A test task.\n"
  end


Code.require_file("../test_helper.exs", __DIR__)

defmodule Mix.TaskTest do
  use MixTest.Case
