Skip to content

Commit

Permalink
Tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Feb 20, 2017
1 parent 6b93877 commit e2abe58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/Hg.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Hg {

gitify({ gitRepoPath = undefined } = {}, done = undefined) {
const repo = new HgRepo(undefined, this.pythonPath);

console.log(gitRepoPath)
return repo.gitify({ gitRepoPath })
.asCallback(done);
}
Expand Down
7 changes: 3 additions & 4 deletions lib/HgRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,11 @@ class HgRepo {
gitRepoPath = Path.resolve(Path.dirname(this.path), `${this.name}-git`),
} = {},
done = undefined) {
return Command
.run(`${this.pythonPath} -V`)
return Command.run(`${this.pythonPath} -V`)
.then((output) => {
if (!output.stderr.includes('2.7')) {
console.log(output.stderr);
throw new Error('Conversion library currently only supports Python 2.7.x ');
console.log(JSON.stringify(output))
throw new Error('Conversion library currently only supports Python 2.7.x.');
}

return ensureGitify(this.pythonPath);
Expand Down
9 changes: 6 additions & 3 deletions tests/Hg.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Test('Setting the python path', (assert) => {
HgLib1.setPythonPath('test');

assert.true(HgLib1.pythonPath === 'test');

HgLib1.setPythonPath('python');

assert.end();
});

Expand Down Expand Up @@ -194,7 +197,7 @@ Test('gitify a Hg repository.', (assert) => {
const base = Path.resolve('tests', 'results', 'Hg', 'gitify');
const path = Path.resolve(base, 'original');
const gitPath = Path.resolve(base, 'gitified');
const origDirectory = process.cwd;
const origDirectory = process.cwd();

const to = { url: path, username: 'testUser', password: 'testPass', path };
let testRepo;
Expand All @@ -207,9 +210,9 @@ Test('gitify a Hg repository.', (assert) => {
.then(() => testRepo.add())
.then(() => testRepo.commit('Adding test data'))
.then(() => {
process.chdir(base);
process.chdir(path);

return Hg.gitify(gitPath);
return Hg.gitify({ gitRepoPath: gitPath });
})
.then(() => {
assert.true(IsThere(gitPath), 'Git repo exists');
Expand Down

0 comments on commit e2abe58

Please sign in to comment.