lib/sinon-doublist-fs/index.js
function FileStub() {
  this.settings = {
    name: '',
    buffer: new Buffer(0),
    readdir: false,
    parentName: '',
    stats: {
      dev: 2114,
      ino: 48064969,
      mode: 33188,
      nlink: 1,
      uid: 85,
      gid: 100,
      rdev: 0,
      size: 0,
      blksize: 4096,
      blocks: 0,
      atime: 'Mon, 10 Oct 2011 23:24:11 GMT',
      mtime: 'Mon, 10 Oct 2011 23:24:11 GMT',
      ctime: 'Mon, 10 Oct 2011 23:24:11 GMT'
    }
  };
}
function FileStub() {
  this.settings = {
    name: '',
    buffer: new Buffer(0),
    readdir: false,
    parentName: '',
    stats: {
      dev: 2114,
      ino: 48064969,
      mode: 33188,
      nlink: 1,
      uid: 85,
      gid: 100,
      rdev: 0,
      size: 0,
      blksize: 4096,
      blocks: 0,
      atime: 'Mon, 10 Oct 2011 23:24:11 GMT',
      mtime: 'Mon, 10 Oct 2011 23:24:11 GMT',
      ctime: 'Mon, 10 Oct 2011 23:24:11 GMT'
    }
  };
}
function FileStub ( ) { this . settings = { name : '' , buffer : new Buffer ( 0 ) , readdir : false , parentName : '' , stats : { dev : 2114 , ino : 48064969 , mode : 33188 , nlink : 1 , uid : 85 , gid : 100 , rdev : 0 , size : 0 , blksize : 4096 , blocks : 0 , atime : 'Mon, 10 Oct 2011 23:24:11 GMT' , mtime : 'Mon, 10 Oct 2011 23:24:11 GMT' , ctime : 'Mon, 10 Oct 2011 23:24:11 GMT' } } ; }
FileStub constructor.

An entry in the map of stubbed files/directories.

Usage:

const stub = new FileStub();
stub
.set('name', '/path/to/file')
.stat('size', 50)
.stat('gid', 2000)
.make();

Configuration:

- `{string} name` Absolute path w/out trailing slash
- Trailing slashes will be dropped.
- `{boolean|array} readdir` Names of direct descendant files/directories
- `false` will lead to `isFile()` returning `true`
- `{string} parentName` Absolute path w/out trailing slash
- `{object} stats` Attributes to be returned by `stat*()` and `lstat*()`
- Initial values are from the `fs.Stats` manual entry.
FileStub constructor .