data refactoring cleanups in some tests

This commit is contained in:
Geoff Schmidt
2012-02-17 01:33:18 -08:00
parent c88dc05ff3
commit 7a8e7f5ea3
4 changed files with 4 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ test("livedata - basics", function () {
assert.isTrue(Meteor.is_client);
assert.isFalse(Meteor.is_server);
var coll = Meteor.Collection("testing");
var coll = new Meteor.Collection("testing");
coll.remove({foo: 'bar'});
assert.length(coll.find({foo: 'bar'}).fetch(), 0);

View File

@@ -21,6 +21,7 @@ Package.on_use(function (api) {
Package.on_test(function (api) {
api.use('livedata', ['client', 'server']);
api.use('mongo-livedata', ['client', 'server']);
api.use('tinytest');
api.add_files('livedata_tests.js', 'client');
});

View File

@@ -531,7 +531,7 @@ LocalCollection._exprForConstraint = function (type, arg, others,
// mongo doesn't support $regex inside a $not for some reason. we
// do, because there's no reason not to that I can see.. but maybe
// we should follow mongo's behavior?
expr = '!' + Collection._exprForOperatorTest(arg, literals);
expr = '!' + LocalCollection._exprForOperatorTest(arg, literals);
search = null;
} else {
throw Error("Unrecognized key in selector: " + type);

View File

@@ -38,6 +38,7 @@ Meteor.Collection = function (name, manager, driver) {
},
// Apply an update from the server.
// XXX better specify this interface (not in terms of a wire message)?
update: function (msg) {
var doc = self._collection.findOne(msg.id);