2019-02-12 19:50:57 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const Filer = require('../../src');
|
|
|
|
const util = require('../lib/test-utils.js');
|
|
|
|
const expect = require('chai').expect;
|
2014-10-17 16:28:03 +00:00
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
describe('fs.Shell', function() {
|
2014-10-17 16:28:03 +00:00
|
|
|
beforeEach(util.setup);
|
|
|
|
afterEach(util.cleanup);
|
|
|
|
|
2018-11-29 00:24:03 +00:00
|
|
|
it('is a function', function() {
|
2019-02-12 19:50:57 +00:00
|
|
|
const fs = util.fs();
|
2014-10-24 18:19:17 +00:00
|
|
|
expect(typeof fs.Shell).to.equal('function');
|
2014-10-17 16:28:03 +00:00
|
|
|
});
|
|
|
|
|
2018-11-29 00:24:03 +00:00
|
|
|
it('should return a FileSystemShell instance', function() {
|
2019-02-12 19:50:57 +00:00
|
|
|
const fs = util.fs();
|
|
|
|
const sh = new fs.Shell();
|
2014-10-17 16:28:03 +00:00
|
|
|
|
|
|
|
expect(sh.prototype).to.deep.equal((new Filer.Shell(fs)).prototype);
|
|
|
|
});
|
|
|
|
|
2018-11-29 00:24:03 +00:00
|
|
|
it('should reflect changes to the prototype', function(){
|
2019-02-12 19:50:57 +00:00
|
|
|
const fs = util.fs();
|
|
|
|
const sh = new fs.Shell();
|
2014-10-17 16:28:03 +00:00
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
Filer.Shell.prototype.test = 'foo';
|
2014-10-17 16:28:03 +00:00
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
expect(sh.test).to.equal('foo');
|
2014-10-17 16:28:03 +00:00
|
|
|
});
|
|
|
|
});
|