Carrooi / Node-FsMock

[ABANDONED] Mock for fs module
MIT License
7 stars 2 forks source link

Auto-created root directory '/' gets created as a file instead of a directory #15

Closed eugirdor closed 9 years ago

eugirdor commented 9 years ago

When you define a file structure such as:

fs = new FS(
    'var/www/index.php': ''
)

fs-mock auto-creates the all the directories in between (i.e., /, /var, /var/www). However, the root directory / gets created as a file instead of a directory.

The following test fails:

it 'should create root directory', ->
    fs = new FS(
        'var/www/index.php': ''
    )
    expect(fs.statSync('/').isDirectory()).to.be.true