Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Pyvenv shouldn't execute activate command
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroaki-yamamoto committed Jan 7, 2017
1 parent ba889e1 commit d369b6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/pyvenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = (command, searchPath, overwriteDefaultSearchPath) => {
return fs.existsSync(path.join(el, 'bin', 'activate'));
});
let commandToPass = [].concat(
path.join(candidatePath[0], 'bin', 'activate'),
`. ${path.join(candidatePath[0], 'bin', 'activate')}`,
command, 'deactivate'
);
return promiseProcess(commandToPass);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-process",
"version": "1.0.7",
"version": "1.0.8",
"description": "Child process that uses Promise Object",
"main": "index.js",
"scripts": {
Expand Down
25 changes: 13 additions & 12 deletions tests/unit/test_pyvenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
});
it('Should call processCall with proper args.', () => {
expect(promiseProcessMock.calledOnce).to.be.true;
expect(promiseProcessMock.calledWithExactly([
path.join(process.cwd(), 'venv', 'bin', 'activate'),
expect(promiseProcessMock.getCall(0).args[0]).to.eql([
`. ${path.join(process.cwd(), 'venv', 'bin', 'activate')}`,
testCommand, 'deactivate',
]));
]);
});
it('The return value should be an instance of promise', () => {
expect(ret).to.eql({});
Expand All @@ -56,10 +56,10 @@
});
it('Should call processCall with proper args.', () => {
expect(promiseProcessMock.calledOnce).to.be.true;
expect(promiseProcessMock.calledWithExactly([].concat(
path.join(process.cwd(), 'venv', 'bin', 'activate'),
expect(promiseProcessMock.getCall(0).args[0]).to.eql([].concat(
`. ${path.join(process.cwd(), 'venv', 'bin', 'activate')}`,
testCommand, 'deactivate'
)));
));
});
it('The return value should be an instance of promise', () => {
expect(ret).to.eql({});
Expand All @@ -78,10 +78,10 @@
});
it('Should call processCall with proper args.', () => {
expect(promiseProcessMock.calledOnce).to.be.true;
expect(promiseProcessMock.calledWithExactly([
path.join('test', 'bin', 'activate'),
expect(promiseProcessMock.getCall(0).args[0]).to.eql([
`. ${path.join('test', 'bin', 'activate')}`,
testCommand, 'deactivate',
]));
]);
});
it('The return value should be an instance of promise', () => {
expect(ret).to.eql({});
Expand All @@ -100,9 +100,10 @@
});
it('Should call processCall with proper args.', () => {
expect(promiseProcessMock.calledOnce).to.be.true;
expect(promiseProcessMock.calledWithExactly([
path.join('test', 'bin', 'activate'), testCommand, 'deactivate',
]));
expect(promiseProcessMock.getCall(0).args[0]).to.eql([
`. ${path.join('test', 'bin', 'activate')}`,
testCommand, 'deactivate',
]);
});
it('The return value should be an instance of promise', () => {
expect(ret).to.eql({});
Expand Down

0 comments on commit d369b6e

Please sign in to comment.