aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Hayes <[email protected]>2013-07-30 10:17:21 -0700
committerGabe Hayes <[email protected]>2013-07-30 10:17:21 -0700
commit11f429f64c225a3e933458aff5b4e500f274455b (patch)
treeebe448e8e5a9b60b0d96aecbcba2229d625d1667
parent5493d956d003dc6e1db8e21684cfc60b2fbc8a24 (diff)
downloadnode-coveralls-11f429f64c225a3e933458aff5b4e500f274455b.tar.xz
node-coveralls-11f429f64c225a3e933458aff5b4e500f274455b.zip
fixed git test
-rw-r--r--lib/fetchGitData.js11
-rw-r--r--test/fetchGitData.js19
2 files changed, 10 insertions, 20 deletions
diff --git a/lib/fetchGitData.js b/lib/fetchGitData.js
index d663716..629d650 100644
--- a/lib/fetchGitData.js
+++ b/lib/fetchGitData.js
@@ -75,7 +75,6 @@ var fetchGitData = function(git) {
exec("git log -1 " + git.head.id + " --pretty=format:'%H'");
} catch (e) {
execGit = false;
- logger.warn("unable to execute git, using default/passed values instead.", e.message);
}
//-- Head
@@ -92,16 +91,8 @@ var fetchGitData = function(git) {
if (execGit) {
//-- Branch
- if ("" === git.branch) {
- git.branch = exec("git branch").split("\n")[0].replace(/^\*\ /, "").trim();
- }
+ git.branch = exec("git branch").split("\n")[0].replace(/^\*\ /, "").trim();
- //-- Remotes
- if (0 !== git.remotes.length) {
- for (i in git.remotes) {
- saveRemote(git.remotes[i].name, git.remotes[i].url, false);
- }
- }
exec("git remote -v").split("\n").forEach(function(remote) {
remote = remote.split(/\s/);
saveRemote(remote[0], remote[1]);
diff --git a/test/fetchGitData.js b/test/fetchGitData.js
index 80c116f..a036e50 100644
--- a/test/fetchGitData.js
+++ b/test/fetchGitData.js
@@ -144,21 +144,20 @@ describe("fetchGitData", function(){
]
});
});
- xit("should execute git commands when a valid commit hash is given", function() {
- process.env.COVERALLS_GIT_COMMIT = "5eaec7e76af0743f9764e617472ef434f283a195";
+ it("should execute git commands when a valid commit hash is given", function() {
+ process.env.COVERALLS_GIT_COMMIT = "HEAD";
process.env.COVERALLS_GIT_BRANCH = "master";
var options = getOptions().git;
- options.head.should.eql({
- "id": "5eaec7e76af0743f9764e617472ef434f283a195",
- "author_name": "cainus",
- "author_email": "[email protected]",
- "committer_name": "cainus",
- "committer_email": "[email protected]",
- "message": "first commit"
- });
+ options.head.should.be.a("object");
+ options.head.author_name.should.not.equal("Unknown Author");
+ options.head.committer_name.should.not.equal("Unknown Committer");
+ options.head.message.should.not.equal("Unknown Commit Message");
options.branch.should.equal("master");
options.should.have.property("remotes");
options.remotes.should.be.instanceof(Array);
options.remotes.length.should.be.above(0);
});
+ it("should join passed remotes when a valid commit hash is given", function() {
+
+ });
});