@@ -285,22 +285,6 @@ describe('utils', function(){
285
285
done ( ) ;
286
286
} )
287
287
288
- describe ( 'clone' , function ( ) {
289
- it ( 'retains RegExp options gh-1355' , function ( done ) {
290
- var a = new RegExp ( 'hello' , 'igm' ) ;
291
- assert . ok ( a . global ) ;
292
- assert . ok ( a . ignoreCase ) ;
293
- assert . ok ( a . multiline ) ;
294
-
295
- var b = utils . clone ( a ) ;
296
- assert . equal ( b . source , a . source ) ;
297
- assert . equal ( a . global , b . global ) ;
298
- assert . equal ( a . ignoreCase , b . ignoreCase ) ;
299
- assert . equal ( a . multiline , b . multiline ) ;
300
- done ( ) ;
301
- } )
302
- } )
303
-
304
288
describe ( 'merge' , function ( ) {
305
289
it ( 'merges two objects together without overriding properties & methods' , function ( done ) {
306
290
function To ( ) {
@@ -332,5 +316,32 @@ describe('utils', function(){
332
316
done ( ) ;
333
317
} )
334
318
} )
319
+
320
+ describe ( 'pluralize (gh-1703)' , function ( ) {
321
+ it ( 'should not pluralize _temp_' , function ( done ) {
322
+ var db = start ( ) ;
323
+
324
+ var ASchema = new Schema ( {
325
+ value : { type : Schema . Types . Mixed }
326
+ } ) ;
327
+
328
+ var collectionName = '_temp_' ;
329
+ var A = db . model ( collectionName , ASchema ) ;
330
+ assert . equal ( A . collection . name , collectionName ) ;
331
+ done ( ) ;
332
+ } ) ;
333
+ it ( 'should pluralize _temp' , function ( done ) {
334
+ var db = start ( ) ;
335
+
336
+ var ASchema = new Schema ( {
337
+ value : { type : Schema . Types . Mixed }
338
+ } ) ;
339
+
340
+ var collectionName = '_temp' ;
341
+ var A = db . model ( collectionName , ASchema ) ;
342
+ assert . equal ( A . collection . name , collectionName + 's' ) ;
343
+ done ( ) ;
344
+ } )
345
+ } ) ;
335
346
} )
336
347
0 commit comments