2018-06-28 23:26:08 +00:00
|
|
|
var Filer = require('../../src');
|
2014-10-17 16:28:03 +00:00
|
|
|
var util = require('../lib/test-utils.js');
|
|
|
|
var expect = require('chai').expect;
|
|
|
|
|
2014-11-14 17:04:51 +00:00
|
|
|
describe("fs.Shell", function() {
|
2014-10-17 16:28:03 +00:00
|
|
|
beforeEach(util.setup);
|
|
|
|
afterEach(util.cleanup);
|
|
|
|
|
|
|
|
it("is a function", function(done) {
|
|
|
|
var 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
|
|
|
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return a FileSystemShell instance', function(done) {
|
|
|
|
var fs = util.fs();
|
2014-10-24 18:19:17 +00:00
|
|
|
var sh = new fs.Shell();
|
2014-10-17 16:28:03 +00:00
|
|
|
|
|
|
|
expect(sh.prototype).to.deep.equal((new Filer.Shell(fs)).prototype);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should reflect changes to the prototype', function(done){
|
|
|
|
var fs = util.fs();
|
2014-10-24 18:19:17 +00:00
|
|
|
var sh = new fs.Shell();
|
2014-10-17 16:28:03 +00:00
|
|
|
|
|
|
|
Filer.Shell.prototype.test = "foo";
|
|
|
|
|
|
|
|
expect(sh.test).to.equal("foo");
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|