@@ -3,8 +3,9 @@ var sqlite = require('sqlite3');
33var pg = require ( 'pg' ) ;
44var should = require ( 'should' ) ;
55var helper = require ( '../support/spec_helper' ) ;
6- var common = require ( '../common' ) ;
76var ORM = require ( '../../' ) ;
7+ var common = require ( '../common' ) ;
8+ var protocol = common . protocol ( ) ;
89
910describe ( "ORM" , function ( ) {
1011 describe ( "when loaded" , function ( ) {
@@ -240,77 +241,79 @@ describe("ORM.connect()", function () {
240241 } ) ;
241242 } ) ;
242243
243- describe ( "query options" , function ( ) {
244- it ( "should understand pool `'false'` from query string" , function ( done ) {
245- var connString = common . getConnectionString ( ) + "debug=false&pool=false" ;
246- ORM . connect ( connString , function ( err , db ) {
247- should . not . exist ( err ) ;
248- should . strictEqual ( db . driver . opts . pool , false ) ;
249- should . strictEqual ( db . driver . opts . debug , false ) ;
250- done ( ) ;
244+ if ( protocol != 'mongodb' ) {
245+ describe ( "query options" , function ( ) {
246+ it ( "should understand pool `'false'` from query string" , function ( done ) {
247+ var connString = common . getConnectionString ( ) + "debug=false&pool=false" ;
248+ ORM . connect ( connString , function ( err , db ) {
249+ should . not . exist ( err ) ;
250+ should . strictEqual ( db . driver . opts . pool , false ) ;
251+ should . strictEqual ( db . driver . opts . debug , false ) ;
252+ done ( ) ;
253+ } ) ;
251254 } ) ;
252- } ) ;
253255
254- it ( "should understand pool `'0'` from query string" , function ( done ) {
255- var connString = common . getConnectionString ( ) + "debug=0&pool=0" ;
256- ORM . connect ( connString , function ( err , db ) {
257- should . not . exist ( err ) ;
258- should . strictEqual ( db . driver . opts . pool , false ) ;
259- should . strictEqual ( db . driver . opts . debug , false ) ;
260- done ( ) ;
256+ it ( "should understand pool `'0'` from query string" , function ( done ) {
257+ var connString = common . getConnectionString ( ) + "debug=0&pool=0" ;
258+ ORM . connect ( connString , function ( err , db ) {
259+ should . not . exist ( err ) ;
260+ should . strictEqual ( db . driver . opts . pool , false ) ;
261+ should . strictEqual ( db . driver . opts . debug , false ) ;
262+ done ( ) ;
263+ } ) ;
261264 } ) ;
262- } ) ;
263265
264- it ( "should understand pool `'true'` from query string" , function ( done ) {
265- var connString = common . getConnectionString ( ) + "debug=true&pool=true" ;
266- ORM . connect ( connString , function ( err , db ) {
267- should . not . exist ( err ) ;
268- should . strictEqual ( db . driver . opts . pool , true ) ;
269- should . strictEqual ( db . driver . opts . debug , true ) ;
270- done ( ) ;
266+ it ( "should understand pool `'true'` from query string" , function ( done ) {
267+ var connString = common . getConnectionString ( ) + "debug=true&pool=true" ;
268+ ORM . connect ( connString , function ( err , db ) {
269+ should . not . exist ( err ) ;
270+ should . strictEqual ( db . driver . opts . pool , true ) ;
271+ should . strictEqual ( db . driver . opts . debug , true ) ;
272+ done ( ) ;
273+ } ) ;
271274 } ) ;
272- } ) ;
273275
274- it ( "should understand pool `'1'` from query string" , function ( done ) {
275- var connString = common . getConnectionString ( ) + "debug=1&pool=1" ;
276- ORM . connect ( connString , function ( err , db ) {
277- should . not . exist ( err ) ;
278- should . strictEqual ( db . driver . opts . pool , true ) ;
279- should . strictEqual ( db . driver . opts . debug , true ) ;
280- done ( ) ;
276+ it ( "should understand pool `'1'` from query string" , function ( done ) {
277+ var connString = common . getConnectionString ( ) + "debug=1&pool=1" ;
278+ ORM . connect ( connString , function ( err , db ) {
279+ should . not . exist ( err ) ;
280+ should . strictEqual ( db . driver . opts . pool , true ) ;
281+ should . strictEqual ( db . driver . opts . debug , true ) ;
282+ done ( ) ;
283+ } ) ;
281284 } ) ;
282- } ) ;
283285
284- it ( "should understand pool `false` from query options" , function ( done ) {
285- var connOpts = _ . extend ( common . getConfig ( ) , {
286- protocol : common . protocol ( ) ,
287- query : {
288- pool : false , debug : false
289- }
290- } ) ;
291- ORM . connect ( connOpts , function ( err , db ) {
292- should . not . exist ( err ) ;
293- should . strictEqual ( db . driver . opts . pool , false ) ;
294- should . strictEqual ( db . driver . opts . debug , false ) ;
295- done ( ) ;
286+ it ( "should understand pool `true` from query options" , function ( done ) {
287+ var connOpts = _ . extend ( common . getConfig ( ) , {
288+ protocol : common . protocol ( ) ,
289+ query : {
290+ pool : true , debug : true
291+ }
292+ } ) ;
293+ ORM . connect ( connOpts , function ( err , db ) {
294+ should . not . exist ( err ) ;
295+ should . strictEqual ( db . driver . opts . pool , true ) ;
296+ should . strictEqual ( db . driver . opts . debug , true ) ;
297+ done ( ) ;
298+ } ) ;
296299 } ) ;
297- } ) ;
298300
299- it ( "should understand pool `true` from query options" , function ( done ) {
300- var connOpts = _ . extend ( common . getConfig ( ) , {
301- protocol : common . protocol ( ) ,
302- query : {
303- pool : true , debug : true
304- }
305- } ) ;
306- ORM . connect ( connOpts , function ( err , db ) {
307- should . not . exist ( err ) ;
308- should . strictEqual ( db . driver . opts . pool , true ) ;
309- should . strictEqual ( db . driver . opts . debug , true ) ;
310- done ( ) ;
301+ it ( "should understand pool `false` from query options" , function ( done ) {
302+ var connOpts = _ . extend ( common . getConfig ( ) , {
303+ protocol : common . protocol ( ) ,
304+ query : {
305+ pool : false , debug : false
306+ }
307+ } ) ;
308+ ORM . connect ( connOpts , function ( err , db ) {
309+ should . not . exist ( err ) ;
310+ should . strictEqual ( db . driver . opts . pool , false ) ;
311+ should . strictEqual ( db . driver . opts . debug , false ) ;
312+ done ( ) ;
313+ } ) ;
311314 } ) ;
312315 } ) ;
313- } ) ;
316+ }
314317} ) ;
315318
316319describe ( "ORM.use()" , function ( ) {
0 commit comments