Skip to content

Commit 8b266bc

Browse files
author
John Haley
committed
Fixed sshKeyNew test on travis and a cred test
1 parent 0406382 commit 8b266bc

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

test/tests/clone.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe("Clone", function() {
88
var http = path.resolve("test/repos/http");
99
var https = path.resolve("test/repos/https");
1010
var ssh = path.resolve("test/repos/ssh");
11+
var sshManual = path.resolve("test/respos/sshmanual");
1112
var git = path.resolve("test/repos/git");
1213
var file = path.resolve("test/repos/file");
1314

@@ -80,7 +81,7 @@ describe("Clone", function() {
8081
}
8182
};
8283

83-
return Clone.clone(url, ssh, opts).then(function(repository) {
84+
return Clone.clone(url, sshManual, opts).then(function(repository) {
8485
assert.ok(repository instanceof Repository);
8586
});
8687
});

test/tests/cred.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ var assert = require("assert");
22

33
describe("Cred", function() {
44
var NodeGit = require("../../");
5+
var sshPublicKey = path.resolve("./id_rsa.pub");
6+
var sshPrivateKey = path.resolve("./id_rsa");
57

68
it("can create default credentials", function() {
79
NodeGit.Cred.defaultNew().then(function (defaultCreds) {
@@ -10,14 +12,13 @@ describe("Cred", function() {
1012
});
1113

1214
it("can create ssh credentials using passed keys", function() {
13-
NodeGit.Cred.sshKeyNew(
15+
var cred = NodeGit.Cred.sshKeyNew(
1416
"username",
15-
"public key",
16-
"private key",
17-
"passphrase")
18-
.then(function (sshCreds) {
19-
assert(sshCreds instanceof NodeGit.Cred);
20-
});
17+
sshPublicKey,
18+
sshPrivateKey,
19+
"");
20+
21+
assert(cred instanceof NodeGit.Cred);
2122
});
2223

2324
it("can create credentials using plaintext", function() {

0 commit comments

Comments
 (0)