diff --git a/.travis.yml b/.travis.yml index 47077fe04..e7aba778f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,6 @@ branches: only: - master script: npm --expose-gc test +notifications: + slack: + secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc= diff --git a/generate/descriptor.json b/generate/descriptor.json index 4207c7d1d..2483a94f5 100644 --- a/generate/descriptor.json +++ b/generate/descriptor.json @@ -284,11 +284,33 @@ "isStruct": true, "cType": "git_cred", "functions": { + "git_cred_default_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false + }, + "git_cred_has_username": { + "ignore": false, + "args": [{ "isSelf": true}] + }, "git_cred_ssh_key_from_agent": { "ignore": false, "isPrototypeMethod": false, "args": [{ "isSelf": false }], "isAsync": false + }, + "git_cred_ssh_key_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false + }, + "git_cred_userpass_plaintext_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false } } }, diff --git a/test/tests/cred.js b/test/tests/cred.js new file mode 100644 index 000000000..46221d7a8 --- /dev/null +++ b/test/tests/cred.js @@ -0,0 +1,29 @@ +var assert = require("assert"); + +describe("Cred", function() { + var NodeGit = require("../../"); + + it("can create default credentials", function() { + var defaultCreds = NodeGit.Cred.defaultNew(); + + assert(defaultCreds instanceof NodeGit.Cred); + }); + + it("can create ssh credentials using passed keys", function() { + var sshCreds + = NodeGit.Cred.sshKeyNew( + "username", + "public key", + "private key", + "passphrase"); + + assert(sshCreds instanceof NodeGit.Cred); + }); + + it("can create credentials using plaintext", function() { + var plaintextCreds + = NodeGit.Cred.userpassPlaintextNew("username", "password"); + + assert(plaintextCreds instanceof NodeGit.Cred); + }); +});