Merge pull request #439 from btd/master

Remove workaround for perfomance degradation in should.js
This commit is contained in:
Raymond Feng 2015-02-10 09:47:42 -08:00
commit 4c2d508151
2 changed files with 3 additions and 7 deletions

View File

@ -24,7 +24,7 @@
],
"devDependencies": {
"mocha": "~1.20.1",
"should": "^4.6.3"
"should": "^5.0.0"
},
"dependencies": {
"async": "~0.9.0",

View File

@ -15,14 +15,10 @@ describe('dataSource', function () {
it('should clone existing model', function () {
SlaveModel = slave.copyModel(Model);
SlaveModel.dataSource.should.equal(slave);
// Workaround for an performance issue in `should` by customizing the msg
// where it takes ages to evaluate `should.not.equal` for complex objects
// https://github.com/shouldjs/should.js/blob/master/lib/assertion.js#L159-L162
slave.should.not.equal(db, 'The two data sources should be different');
slave.should.not.equal(db);
var sm = new SlaveModel;
sm.should.be.instanceOf(Model);
sm.getDataSource().should.not.equal(db, 'The data source of an instance ' +
'of the slave model should be different from the original one');
sm.getDataSource().should.not.equal(db);
sm.getDataSource().should.equal(slave);
});