Skip to content

Commit 6efb19c

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

2 files changed

Lines changed: 11 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: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
var assert = require("assert");
2+
var path = require("path");
23

34
describe("Cred", function() {
45
var NodeGit = require("../../");
6+
var sshPublicKey = path.resolve("./id_rsa.pub");
7+
var sshPrivateKey = path.resolve("./id_rsa");
58

69
it("can create default credentials", function() {
710
NodeGit.Cred.defaultNew().then(function (defaultCreds) {
@@ -10,14 +13,13 @@ describe("Cred", function() {
1013
});
1114

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

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

0 commit comments

Comments
 (0)