|
|
@ -329,7 +329,7 @@ describe('Model', function () { |
|
|
|
}); // ==== End of 'Modifying documents' ==== //
|
|
|
|
}); // ==== End of 'Modifying documents' ==== //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe.only('Comparing things', function () { |
|
|
|
describe('Comparing things', function () { |
|
|
|
|
|
|
|
|
|
|
|
it('null is less than everything except null', function () { |
|
|
|
it('null is less than everything except null', function () { |
|
|
|
var otherStuff = ["string", "", -1, 0, 5.3, 12, true, false, new Date(12345), {}, { hello: 'world' }, [], ['quite', 5]]; |
|
|
|
var otherStuff = ["string", "", -1, 0, 5.3, 12, true, false, new Date(12345), {}, { hello: 'world' }, [], ['quite', 5]]; |
|
|
@ -436,6 +436,14 @@ describe('Model', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('And finally objects', function () { |
|
|
|
|
|
|
|
model.compareThings({}, {}).should.equal(0); |
|
|
|
|
|
|
|
model.compareThings({ a: 42 }, { a: 312}).should.equal(-1); |
|
|
|
|
|
|
|
model.compareThings({ a: '42' }, { a: '312'}).should.equal(1); |
|
|
|
|
|
|
|
model.compareThings({ a: 42, b: 312 }, { b: 312, a: 42 }).should.equal(0); |
|
|
|
|
|
|
|
model.compareThings({ a: 42, b: 312, c: 54 }, { b: 313, a: 42 }).should.equal(-1); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); // ==== End of 'Comparing things' ==== //
|
|
|
|
}); // ==== End of 'Comparing things' ==== //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|