Commit be3955eb authored by Carson Howard's avatar Carson Howard Committed by Carson Howard

Fixed unit tests

parent d7eff48e
......@@ -3,6 +3,7 @@ var path = require("path");
var local = path.join.bind(path, __dirname);
var promisify = require("promisify-node");
var fse = promisify("fs-extra");
var exec = require("../../utils/execPromise");
describe("Blob", function() {
var NodeGit = require("../../");
......@@ -14,6 +15,7 @@ describe("Blob", function() {
var reposPath = local("../repos/workdir");
var oid = "111dd657329797f6165f52f5085f61ac976dcf04";
var previousCommitOid = "";
function commitFile(repo, fileName, fileContent, commitMessage) {
var index;
......@@ -64,6 +66,16 @@ describe("Blob", function() {
});
}
before(function() {
return Repository.open(reposPath)
.then(function(repository) {
return repository.getHeadCommit();
})
.then(function(commit) {
previousCommitOid = commit.id();
});
});
beforeEach(function() {
var test = this;
......@@ -78,6 +90,17 @@ describe("Blob", function() {
});
});
after(function() {
console.log("cleaning");
return exec("git clean -xdf", {cwd: reposPath})
.then(function() {
return exec("git checkout master", {cwd: reposPath});
})
.then(function() {
return exec("git reset --hard " + previousCommitOid, {cwd: reposPath});
});
});
it("can provide content as a buffer", function() {
var contents = this.blob.content();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment