2014-07-28 22:14:59 +00:00
|
|
|
var Filer = require('../..');
|
|
|
|
var util = require('../lib/test-utils.js');
|
|
|
|
var expect = require('chai').expect;
|
|
|
|
|
|
|
|
describe('sh.cd doesn\'t seem to be working from a relative path if I am one or more folders deep, #247', function() {
|
|
|
|
beforeEach(util.setup);
|
|
|
|
afterEach(util.cleanup);
|
|
|
|
|
|
|
|
it('should properly deal with relative paths missing ./ and ../', function(done) {
|
|
|
|
var fs = util.fs();
|
2014-12-17 07:54:29 +00:00
|
|
|
var sh = new fs.Shell();
|
2014-07-28 22:14:59 +00:00
|
|
|
|
|
|
|
sh.mkdirp('/home/scott', function(err) {
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
sh.cd('/', function(err) {
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
expect(sh.pwd()).to.equal('/');
|
|
|
|
|
|
|
|
sh.cd('home', function(err) {
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
expect(sh.pwd()).to.equal('/home');
|
|
|
|
|
|
|
|
sh.cd('scott', function(err) {
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
expect(sh.pwd()).to.equal('/home/scott');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|