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

Add a feature allowing base files creation #1

Open simonc opened 11 years ago

simonc commented 11 years ago

Sometimes you need to have already existing directories and files for your tests. Being able to provide a base listing of it would be useful.

Two formats could be possible:

/test-dir/other-dir/file.rb         # would create the file and parent directories
/test-dir/other-dir2/               # would create the directory and its parent
...

Or

/test-dir/
  other-dir/
    file.rb
  other-dir2/

The first one is simpler and probably easier to read in the end.