4 ms·
Java has in-memory file systems that are essentially geared for this exact use case, eg jimfs[0]. You create your filesystem and any files you need when your te
by cgh 3y ago
Java has in-memory file systems that are essentially geared for this exact use case, eg jimfs[0]. You create your filesystem and any files you need when your tests are starting up, and your classes talk to them rather than the “real” ones. Maybe a similar project exists for the C++ ecosystem?
[0] https://github.com/google/jimfs https://github.com/google/jimfs
- seeknotfind 3y agoYou can use FUSE :)
- vardump 3y agoSadly, FUSE is far from fast. Great for quick fixes though, it's crazy to be able to locally mount a disk image that sits on the other side of the world on an HTTP server.
- seeknotfind 3y agoAs far as it's ability as an FS mocking layer for tests, I'd think its principle disadvantage would be on FUSE only making sense on UNIX-like systems.
- deleted 3y ago[deleted]