maint: Stub spec test so directory is not created unnecessarily
One of the spec tests required that the parent directory (in this case
/tmp) already exist and that /tmp/my_directory could be created. This
fails on Windows as /tmp likely doesn't exist, and also the test
doesn't actually need to create the directory.
This commit forces the call to exists? with the parent directory to
return true, and stubs the mkdir call so that the directory is not
actually created.
It also makes the raise_error expectation look for the specific error
message, instead of a generic DevError.