Skip to content

Commit bd82b7b

Browse files
committed
Fixed test names
1 parent 5b0c6f4 commit bd82b7b

File tree

8 files changed

+30
-42
lines changed

8 files changed

+30
-42
lines changed

lib/mongodb/collection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ Collection.prototype.count = function count (query, options, callback) {
575575
if(typeof limit == 'number') commandObject.limit = limit;
576576

577577
// Set read preference if we set one
578-
var readPreference = _getReadConcern(this, options);
578+
options.readPreference = _getReadConcern(this, options);
579579

580580
// Execute the command
581581
this.db.command(commandObject, options, function(err, result) {

test/tests/functional/admin_mode_tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exports.shouldCorrectlyCallValidateCollectionUsingAuthenticatedMode = function(c
4242
* @_function authenticate
4343
* @ignore
4444
*/
45-
exports.shouldCorrectlyAuthenticate_A = function(configure, test) {
45+
exports.shouldCorrectlyAuthenticate = function(configure, test) {
4646
var db = configure.newDbInstance({w:1}, {poolSize:1});
4747
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
4848
// DOC_START
@@ -84,7 +84,7 @@ exports.shouldCorrectlyAuthenticate_A = function(configure, test) {
8484
* @_function admin
8585
* @ignore
8686
*/
87-
exports.shouldCorrectlyAuthenticate_B = function(configure, test) {
87+
exports.accessAdminLevelOperations = function(configure, test) {
8888
var db = configure.newDbInstance({w:1}, {poolSize:1});
8989
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
9090
// DOC_START
@@ -107,7 +107,7 @@ exports.shouldCorrectlyAuthenticate_B = function(configure, test) {
107107
* @_function buildInfo
108108
* @ignore
109109
*/
110-
exports.shouldCorrectlyAuthenticate_C = function(configure, test) {
110+
exports.shouldCorrectlyRetrieveBuildInfo = function(configure, test) {
111111
var db = configure.newDbInstance({w:1}, {poolSize:1});
112112

113113
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
@@ -149,7 +149,7 @@ exports.shouldCorrectlyAuthenticate_C = function(configure, test) {
149149
* @_function command
150150
* @ignore
151151
*/
152-
exports.shouldCorrectlyAuthenticate_D = function(configure, test) {
152+
exports.shouldCorrectlyRetrieveBuildInfoUsingCommand = function(configure, test) {
153153
var db = configure.newDbInstance({w:1}, {poolSize:1});
154154

155155
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));

test/tests/functional/db_tests.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,13 @@ exports.shouldCorrectlyOpenASimpleDbSingleServerConnectionAndCloseWithCallback =
431431
}
432432

433433
/**
434-
* An example of retrieveing the information of all the collections.
434+
* An example of retrieving the information of all the collections.
435435
*
436436
* @_class db
437437
* @_function collectionsInfo
438438
* @ignore
439439
*/
440-
exports.shouldCorrectlyRetrieveCollectionInfo_A = function(configuration, test) {
440+
exports.shouldCorrectlyRetrieveCollectionInformation = function(configuration, test) {
441441
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
442442

443443
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
@@ -472,13 +472,13 @@ exports.shouldCorrectlyRetrieveCollectionInfo_A = function(configuration, test)
472472
}
473473

474474
/**
475-
* An example of retrieveing the collection names for a database.
475+
* An example of retrieving the collection names for a database.
476476
*
477477
* @_class db
478478
* @_function collectionNames
479479
* @ignore
480480
*/
481-
exports.shouldCorrectlyRetrieveCollectionInfo_B = function(configuration, test) {
481+
exports.shouldCorrectlyRetrieveCollectionNames = function(configuration, test) {
482482
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
483483

484484
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
@@ -728,7 +728,7 @@ exports.shouldCorrectlyLogoutFromTheDatabase = function(configuration, test) {
728728
* @_function authenticate
729729
* @ignore
730730
*/
731-
exports.shouldCorrectlyAuthenticateAgainstTheDatabase_A = function(configuration, test) {
731+
exports.shouldCorrectlyAuthenticateAgainstTheDatabase = function(configuration, test) {
732732
if(configuration.db().serverConfig instanceof configuration.getMongoPackage().ReplSet) return test.done();
733733
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
734734

@@ -761,7 +761,7 @@ exports.shouldCorrectlyAuthenticateAgainstTheDatabase_A = function(configuration
761761
* @_function addUser
762762
* @ignore
763763
*/
764-
exports.shouldCorrectlyAuthenticateAgainstTheDatabase_B = function(configuration, test) {
764+
exports.shouldCorrectlyAddUserToDb = function(configuration, test) {
765765
if(configuration.db().serverConfig instanceof configuration.getMongoPackage().ReplSet) return test.done();
766766
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
767767

@@ -1374,7 +1374,7 @@ exports.shouldCorrectlyForceReindexOnCollection = function(configuration, test)
13741374
* @_class db
13751375
* @_function indexInformation
13761376
*/
1377-
exports.shouldCorrectlyShowTheResultsFromIndexInformation_A = function(configuration, test) {
1377+
exports.shouldCorrectlyShowTheResultsFromIndexInformation = function(configuration, test) {
13781378
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
13791379

13801380
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
@@ -1422,7 +1422,7 @@ exports.shouldCorrectlyShowTheResultsFromIndexInformation_A = function(configura
14221422
* @_class db
14231423
* @_function dropDatabase
14241424
*/
1425-
exports.shouldCorrectlyShowTheResultsFromIndexInformation_B = function(configuration, test) {
1425+
exports.shouldCorrectlyDropTheDatabase = function(configuration, test) {
14261426
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
14271427

14281428
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));

test/tests/functional/find_tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ exports.shouldPerformSimpleFindInArray = function(configuration, test) {
14071407
* @_class collection
14081408
* @_function findAndModify
14091409
*/
1410-
exports.shouldPerformSimpleFindAndModifyOperations_A = function(configuration, test) {
1410+
exports.shouldPerformSimpleFindAndModifyOperations = function(configuration, test) {
14111411
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
14121412

14131413
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));
@@ -1465,7 +1465,7 @@ exports.shouldPerformSimpleFindAndModifyOperations_A = function(configuration, t
14651465
* @_class collection
14661466
* @_function findAndRemove
14671467
*/
1468-
exports.shouldPerformSimpleFindAndModifyOperations_B = function(configuration, test) {
1468+
exports.shouldPerformSimpleFindAndRemove = function(configuration, test) {
14691469
var db = configuration.newDbInstance({w:0}, {poolSize:1, auto_reconnect:false});
14701470

14711471
// DOC_LINE var db = new Db('test', new Server('locahost', 27017));

test/tests/functional/mongo_reply_parser_tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ exports['Should correctly parse message + in two packets from socket and smaller
244244
/**
245245
* @ignore
246246
*/
247-
exports['Should correctly parse message + in two packets from socket and smaller than 4 bytes additional one then partial message A'] = function(configuration, test) {
247+
exports['Should correctly parse message + in two packets from socket and smaller than 4 bytes additional one then partial message'] = function(configuration, test) {
248248
// Data object
249249
var index = 0;
250250
var buffer = new Buffer(20);
@@ -295,7 +295,7 @@ exports['Should correctly parse message + in two packets from socket and smaller
295295
/**
296296
* @ignore
297297
*/
298-
exports['Should correctly parse message + in two packets from socket and smaller than 4 bytes additional one then partial message B'] = function(configuration, test) {
298+
exports['Should correctly parse message + in two packets from socket and smaller than 4 bytes additional one then partial message into a bigger buffer'] = function(configuration, test) {
299299
// Data object
300300
var index = 0;
301301
var buffer = new Buffer(40);

test/tests/functional/objectid_tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ exports.shouldCorrectlyGenerate12ByteStringFromTimestamp = function(configuratio
8484
* @_function toHexString
8585
* @ignore
8686
*/
87-
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString_A = function(configuration, test) {
87+
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToHexString = function(configuration, test) {
8888
var ObjectID = configuration.getMongoPackage().ObjectID;
8989
// DOC_START
9090
// Create a new ObjectID
@@ -125,7 +125,7 @@ exports.shouldCorrectlyGetAndSetObjectIDUsingGenerationTimeProperty = function(c
125125
/**
126126
* @ignore
127127
*/
128-
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString_B = function(configuration, test) {
128+
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString = function(configuration, test) {
129129
var ObjectID = configuration.getMongoPackage().ObjectID;
130130
// Create a new ObjectID
131131
var objectId = new ObjectID();
@@ -137,7 +137,7 @@ exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString_B = function(con
137137
/**
138138
* @ignore
139139
*/
140-
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString_C = function(configuration, test) {
140+
exports.shouldCorrectlyRetrieve24CharacterHexStringFromToJSON = function(configuration, test) {
141141
var ObjectID = configuration.getMongoPackage().ObjectID;
142142
// Create a new ObjectID
143143
var objectId = new ObjectID();
@@ -153,7 +153,7 @@ exports.shouldCorrectlyRetrieve24CharacterHexStringFromToString_C = function(con
153153
* @_function ObjectID.createFromHexString
154154
* @ignore
155155
*/
156-
exports.shouldCorrectlyTransformObjectIDToAndFromHexString_A = function(configuration, test) {
156+
exports.shouldCorrectlyTransformObjectIDToHexAndObjectId = function(configuration, test) {
157157
var ObjectID = configuration.getMongoPackage().ObjectID;
158158
// DOC_START
159159
// Create a new ObjectID
@@ -177,7 +177,7 @@ exports.shouldCorrectlyTransformObjectIDToAndFromHexString_A = function(configur
177177
* @_function equals
178178
* @ignore
179179
*/
180-
exports.shouldCorrectlyTransformObjectIDToAndFromHexString_B = function(configuration, test) {
180+
exports.shouldCorrectlyDifferentiateBetweenObjectIdInstances = function(configuration, test) {
181181
var ObjectID = configuration.getMongoPackage().ObjectID;
182182
// DOC_START
183183
// Create a new ObjectID
@@ -295,7 +295,7 @@ exports.shouldCorrectlyInsertWithObjectId = function(configuration, test) {
295295
* @_function ObjectID.createFromTime
296296
* @ignore
297297
*/
298-
exports.shouldCorrectlyTransformObjectIDToAndFromHexString_C = function(configuration, test) {
298+
exports.shouldCorrectlyUseCreateFromTime = function(configuration, test) {
299299
var ObjectID = configuration.getMongoPackage().ObjectID;
300300
// DOC_START
301301
var objectId = ObjectID.createFromTime(1);

test/tests/functional/uri_tests.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ exports['Should correctly connect via normal url using require'] = function(conf
151151
});
152152
}
153153

154-
exports['Should correctly connect via normal url A'] = function(configuration, test) {
154+
exports['Should correctly connect via normal url safe set to false'] = function(configuration, test) {
155155
if(configuration.db().serverConfig instanceof configuration.getMongoPackage().ReplSet) return test.done();
156156
var Db = configuration.getMongoPackage().Db;
157157

@@ -162,18 +162,7 @@ exports['Should correctly connect via normal url A'] = function(configuration, t
162162
});
163163
}
164164

165-
exports['Should correctly connect via normal url B'] = function(configuration, test) {
166-
if(configuration.db().serverConfig instanceof configuration.getMongoPackage().ReplSet) return test.done();
167-
var Db = configuration.getMongoPackage().Db;
168-
169-
Db.connect("mongodb://localhost?journal=true", function(err, db) {
170-
// test.equal(false, db.safe);
171-
db.close();
172-
test.done();
173-
});
174-
}
175-
176-
exports['Should correctly connect via normal url C'] = function(configuration, test) {
165+
exports['Should correctly connect via normal url journal option'] = function(configuration, test) {
177166
if(configuration.db().serverConfig instanceof configuration.getMongoPackage().ReplSet) return test.done();
178167
var Db = configuration.getMongoPackage().Db;
179168

test/tests/repl_set/read_preferences_spec_tests.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,11 @@ exports['Should Correctly Vary read server when using readpreference NEAREST'] =
182182
// Open the database
183183
var db = new Db('integration_test_', replSet, {w:1});
184184
db.open(function(err, db) {
185-
// // Force selection of a secondary
186-
// db.serverConfig._state.master.runtimeStats['pingMs'] = 5000;
187-
// // Check that we get a secondary
188-
// var connection = db.serverConfig.checkoutReader();
189-
// var keys = Object.keys(db.serverConfig._state.secondaries);
190-
// var found = false;
185+
// Check that we are getting different servers
186+
var connection = db.serverConfig.checkoutReader();
187+
var port = connection.socketOptions.port;
188+
connection = db.serverConfig.checkoutReader();
189+
test.ok(port != connection.socketOptions.port);
191190

192191
// Execute a query
193192
db.collection('nearest_collection_test').insert({a:1}, {w:3, wtimeout:10000}, function(err, doc) {

0 commit comments

Comments
 (0)