 
       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

    test :mkdir_p_with_invalid_path do
      assert File.exists?(fixture_path("file.txt"))
      invalid = Path.join fixture_path("file.txt"), "test/foo"
      assert (File.mkdir(invalid) |> is_io_error?)
      refute File.exists?(invalid)
    end

