       File.cp!(file, Path.join([src, "pages", Path.basename(file)]))
     end)
 
-    assert {:error, _} = build(src, dest)
+    assert {:error, _} = mute_stdio(do: Build.build(proj))
   end
-
-  defp build(src, dest), do: mute_stdio(do: Build.build(src, dest))
 end


    on_exit(fn -> File.rm_rf!(tmp_dir) end)

    {:ok, [src: src, dest: dest]}
  end

  test "everything went well", %{src: src, dest: dest} do
    assert {:ok, ^dest} = build(src, dest)

    # Clean the destination dir when is not empty
    assert {:ok, ^dest} = build(src, dest)
  end

  test "skip copying assets and media", %{src: src, dest: dest} do
    File.rm_rf!(Path.join(src, "assets"))
    File.rm_rf!(Path.join(src, "media"))

    assert {:ok, ^dest} = build(src, dest)
  end

  test "failed to process proj", %{src: src, dest: dest} do
    File.rm!(Path.join(src, "serum.exs"))

    assert {:error, _} = build(src, dest)
  end

  test "no write permission on dest", %{src: src, dest: dest} do
    File.chmod!(dest, 0o555)

    assert {:error, _} = build(src, dest)

    File.chmod!(dest, 0o755)
    File.rm_rf!(dest)


    File.cp!(fixture("proj/good/serum.exs"), Path.join(src, "serum.exs"))
    File.cp!(fixture("templates/nav.html.eex"), Path.join(src, "includes/nav.html.eex"))
    {:ok, proj} = ProjectLoader.load(src, dest)

    [
      "base.html.eex",
