-Code.require_file "../../test_helper.exs", __DIR__
+Code.require_file("../../test_helper.exs", __DIR__)
 
 defmodule Mix.Tasks.NewTest do
   use MixTest.Case
 
   test "new" do
     in_tmp "new", fn ->
-      Mix.Tasks.New.run ["hello_world"]
+      Mix.Tasks.New.run(["hello_world"])
 
-      assert_file "hello_world/mix.exs", fn(file) ->
+      assert_file("hello_world/mix.exs", fn file ->
         assert file =~ "app: :hello_world"
         assert file =~ "version: \"0.1.0\""
-      end
+      end)
 
-      assert_file "hello_world/README.md", ~r/# HelloWorld\n/
-      assert_file "hello_world/.gitignore"
+      assert_file("hello_world/README.md", ~r/# HelloWorld\n/)
+      assert_file("hello_world/.gitignore")
 
-      assert_file "hello_world/lib/hello_world.ex",  ~r/defmodule HelloWorld do/
+      assert_file("hello_world/lib/hello_world.ex", ~r/defmodule HelloWorld do/)
 
-      assert_file "hello_world/test/test_helper.exs", ~r/ExUnit.start()/
-      assert_file "hello_world/test/hello_world_test.exs", fn(file) ->
+      assert_file("hello_world/test/test_helper.exs", ~r/ExUnit.start()/)
+
+      assert_file("hello_world/test/hello_world_test.exs", fn file ->
         assert file =~ ~r/defmodule HelloWorldTest do/
         assert file =~ "assert HelloWorld.hello() == :world"
-      end
+      end)
 
       assert_received {:mix_shell, :info, ["* creating mix.exs"]}
       assert_received {:mix_shell, :info, ["* creating lib/hello_world.ex"]}


  test "new with --app" do
    in_tmp "new app", fn ->
      Mix.Tasks.New.run ["HELLO_WORLD", "--app", "hello_world"]

      assert_file "HELLO_WORLD/mix.exs", fn(file) ->
        assert file =~ "app: :hello_world"
        assert file =~ "version: \"0.1.0\""
      end

      assert_file "HELLO_WORLD/README.md", ~r/# HelloWorld\n/
      assert_file "HELLO_WORLD/.gitignore"

      assert_file "HELLO_WORLD/lib/hello_world.ex",  ~r/defmodule HelloWorld do/

      assert_file "HELLO_WORLD/test/test_helper.exs", ~r/ExUnit.start()/
      assert_file "HELLO_WORLD/test/hello_world_test.exs", ~r/defmodule HelloWorldTest do/

      assert_received {:mix_shell, :info, ["* creating mix.exs"]}
      assert_received {:mix_shell, :info, ["* creating lib/hello_world.ex"]}


  test "new with --sup" do
    in_tmp "new sup", fn ->
      Mix.Tasks.New.run(["hello_world", "--sup"])

      assert_file("hello_world/mix.exs", fn file ->
        assert file =~ "app: :hello_world"
        assert file =~ "version: \"0.1.0\""
        assert file =~ "mod: {HelloWorld.Application, []}"
      end)

      assert_file("hello_world/README.md", ~r/# HelloWorld\n/)
      assert_file("hello_world/.gitignore")

      assert_file("hello_world/lib/hello_world.ex", fn file ->
        assert file =~ "defmodule HelloWorld do"
        assert file =~ "def hello do"
      end)

      assert_file("hello_world/lib/hello_world/application.ex", fn file ->
        assert file =~ "defmodule HelloWorld.Application do"
        assert file =~ "use Application"
        assert file =~ "Supervisor.start_link(children, opts)"
      end)

      assert_file("hello_world/test/test_helper.exs", ~r/ExUnit.start()/)
      assert_file("hello_world/test/hello_world_test.exs", ~r/defmodule HelloWorldTest do/)

      assert_received {:mix_shell, :info, ["* creating mix.exs"]}
      assert_received {:mix_shell, :info, ["* creating lib/hello_world.ex"]}
