@@ -27,40 +27,21 @@ function runTest(options) {
2727 db . collection ( "testCommands" ) . findAndModify ( options . query , options . sort || { } , options . update , options . options , function ( err , res ) {
2828 should . not . exist ( err ) ;
2929 console . log ( JSON . stringify ( res ) ) ;
30-
31-
32- if ( options . options . remove ) {
33- res = res || { } ;
34- if ( options . query . _id ) {
35- res . should . have . property ( "_id" , options . query . _id ) ;
36- }
37- else {
38- res . should . have . property ( "_id" ) ;
39- }
40-
41- if ( options . query . name ) {
42- res . should . have . property ( "name" , options . query . name ) ;
43- }
44- else {
45- res . should . have . property ( "name" ) ;
30+ res . should . have . property ( "value" ) ;
31+ if ( options . options . new ) {
32+ if ( options . update . $set . name ) {
33+ res . value . should . have . property ( "name" , options . update . $set . name ) ;
4634 }
4735 }
4836 else {
49- res . should . have . property ( "value" ) ;
50- if ( options . options . new ) {
51- if ( options . update . $set . name ) {
52- res . value . should . have . property ( "name" , options . update . $set . name ) ;
53- }
54- }
55- else {
56- if ( options . query . name ) {
57- res . value . should . have . property ( "name" , options . query . name ) ;
58- }
59- }
60- if ( options . query . _id ) {
61- res . value . should . have . property ( "_id" , options . query . _id ) ;
37+ if ( options . query . name ) {
38+ res . value . should . have . property ( "name" , options . query . name ) ;
6239 }
6340 }
41+ if ( options . query . _id ) {
42+ res . value . should . have . property ( "_id" , options . query . _id ) ;
43+ }
44+
6445 done ( ) ;
6546 } ) ;
6647 }
0 commit comments