Skip to content

Commit a7d881a

Browse files
committed
Test it.
1 parent eced9c3 commit a7d881a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/tests/submodule.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var assert = require("assert");
2+
var path = require("path");
3+
var local = path.join.bind(path, __dirname);
4+
5+
describe("Submodule", function() {
6+
var NodeGit = require("../../");
7+
var Repository = NodeGit.Repository;
8+
var Submodule = NodeGit.Submodule;
9+
var repoPath = local("../repos/workdir");
10+
11+
beforeEach(function() {
12+
var test = this;
13+
14+
return Repository.open(repoPath)
15+
.then(function(repo) {
16+
test.repository = repo;
17+
});
18+
});
19+
20+
it("can walk over the submodules", function() {
21+
return Submodule.foreach(this.repository, function(submodule,
22+
name, context) {
23+
assert.equal(name, "vendor/libgit2");
24+
assert.notEqual(submodule, null);
25+
});
26+
});
27+
});

0 commit comments

Comments
 (0)