cloudhead/vows — Issue #186: Duplication of tests
Author: johnnywengluu
Created: 2012-01-24 22:35:27+00:00
State: open

For some weird reasons I get duplication of tests:

Instead of:

♢ Division by Zero

when clearing the database
✓ and checking
✓ all nodes should have been deleted
when setting up the database
✓ nodes should have been
✓ created

✓ OK » 4 honored (1.083s)

I get:

♢ Division by Zero

when clearing the database
✓ and checking
✓ all nodes should have been deleted
✓ and checking
✓ all nodes should have been deleted
when setting up the database
✓ nodes should have been
✓ created

✓ OK » 4 honored (1.083s)

Here is my test:

module.exports.test = vows.describe('Division by Zero').addBatch({
'when clearing the database': {
topic: function () {
db.clearDatabase(this.callback);
},
'and checking': function () {
var config = {
url: url,
query: "START indexedNode = node:vertices(name = 'Store') RETURN indexedNode.name"
};

yobi.dbHttp.cypher(config, this.callback);
},
'all nodes should have been deleted': function (err, res) {
should.not.exist(err);
should.exist(res);
}
}
}).addBatch({
'when setting up the database': {
topic: function () {
db.setupDatabase(this.callback);
},

'nodes should have been': function (err, res) {
var config = {
url: url,
query: "START indexedNode = node:groups(name = 'Organizations') RETURN indexedNode.name"
};

yobi.dbHttp.cypher(config, this.callback);
},

'created': function (err, res) {
should.not.exist(err);
should.exist(res);
}
}
});

Anyone here has encountered the same issue?