M
Martin DeMello
Francis Hwang said:Aw, for Pete's sake. I guess that's what I guess for not checking RAA
..
So I guess I better rename my FileSystem to something else. Suggestions?
Mock::FileSystem?
martin
Francis Hwang said:Aw, for Pete's sake. I guess that's what I guess for not checking RAA
..
So I guess I better rename my FileSystem to something else. Suggestions?
Francis Hwang said:Well, it's interesting, I think some of us would like something like
this to be really distracting, and others would like it to be
completely transparent. The two are pretty opposite in my mind, but I
suppose there's no reason I couldn't support both, with an option to
use one or the other depending on what files get included. Maybe by
default we'd use, say MockFS.file and MockFS.file_utils to get the
classes, but then if you wanted you could have your code simply use
File and FileUtils, your test code could require 'mockfs/voodoo' or
some such file to redefine those constants. I'll have to look into the
details.
FileSystem is the wrong name anyhow - since many operating systems can
have more than one type of filesystem, where the differences matter at
the file *service* layer. Consider differences in valid name
characters,
path lengths, etc, for filesystems like iso9660, SMBFS, NTFS, etc.
We have had a FileService class in our C++ code for years, not only for
mocking but also for impersonation and remoting. I suggest that might
be a good name for a Ruby class also.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.