 
       try do
         File.touch!(dest)
-        assert File.cp_r(src, dest) == { :error, :enotdir }
+        assert (File.cp_r(src, dest) |> is_io_error?)
       after
         File.rm_rf dest
       end

  defp last_year({ { year, month, day }, time }) do
    { { year - 1, month, day }, time }
  end
end

        File.mkdir_p!(invalid)
      end
    end
    
    defp is_io_error?(result) do
      {:error,errorcode} = result
      errorcode in [:enotdir, :eio, :enoent, :eisdir]
    end

  end

  defmodule Rm do
