 
   test :touch_with_failure! do
     fixture = fixture_path("file.txt/bar")
-    assert_raise File.Error, "could not touch #{fixture}: not a directory", fn ->
+    assert_raise File.Error, %r"could not touch #{escape fixture}: (not a directory|no such file or directory)", fn ->
       File.touch!(fixture)
     end
   end

Code.require_file "test_helper.exs", __DIR__

defmodule FileTest do
  import PathHelpers

  use ExUnit.Case

  defmodule Cp do
    use ExUnit.Case

  end

  test :invalid_cd! do
    message = %r"^could not set current working directory to #{escape fixture_path("file.txt")}: (not a directory|no such file or directory)"
    assert_raise File.Error, message, fn ->
      File.cd!(fixture_path("file.txt"))
    end
