started to changed the code. Added tests.
This commit is contained in:
1 parent
3c8aafcbc2
commit
cfbf2aa42f
4 files changed
+97
-46
No files matched your search
@@ -0,0 +1,27 @@
|
||||
var expect = require('expect.js')
|
||||
, utils = require('../lib/index.js')
|
||||
|
||||
describe('The lib util interface', function () {
|
||||
describe('the Hg object', function () {
|
||||
it('should always pass', function(){
|
||||
expect(1).to.be(1);
|
||||
});
|
||||
var hg = new utils.Hg();
|
||||
it('should get the branched name from the script stdout', function () {
|
||||
var stdout = "a\nb\nc\n";
|
||||
expect(hg.getNameOfMercurialBranchesOutOfScriptStdout(stdout)).to.eql(["a", "b", "c"]);
|
||||
})
|
||||
})
|
||||
|
||||
describe('the config object', function(){
|
||||
it('should be able to initiate properly', function () {
|
||||
var config = new utils.Config();
|
||||
expect(config.url).to.eql("");
|
||||
expect(config.auth.username).to.eql("");
|
||||
config = new utils.Config({url: "1", auth: {username: "2"}});
|
||||
expect(config.url).to.eql("1");
|
||||
expect(config.auth.username).to.eql("2");
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user