simonc / memfs

MemFs provides a fake file system that can be used for tests. Strongly inspired by FakeFS.
MIT License
322 stars 27 forks source link

Map existing files for reading to MemFs #9

Open theldoria opened 10 years ago

theldoria commented 10 years ago

It would be great if I could map existing files into MemFs virtual file system for reading:

MemFs.map("my_file", "my_other_file") # Map file "my_file", "my_other_file"
MemFs.map("my_files_directory") # Map directory "my_file_directory"
MemFs.map("my_files_directory" => "my_virtual_directory") # Map directory "my_file_directory" to "my_virtual_directory"
simonc commented 10 years ago

That's a very good idea. Would you be able to propose an implementation for this? :) When you say "map directory", do you mean mapping all files and sub-directories recursively?

theldoria commented 10 years ago

Sure, I can prepare a pull request.

Regarding "map Directory": yes, mapping of directories is ment to be recursively.

simonc commented 10 years ago

Awesome! :) Keep me posted and ask anything if you need help ;)