@@ -378,9 +378,12 @@ describe('Requests:', function() {
378378 . and . calledWith ( 'requestTwo' , 'argTwo' ) ;
379379 } ) ;
380380
381- it ( 'should return an array of replies' , function ( ) {
381+ it ( 'should return an object of replies' , function ( ) {
382382 expect ( this . Requests . request )
383- . to . have . returned ( [ 'replyOne' , 'replyTwo' ] ) ;
383+ . to . have . returned ( {
384+ requestOne : 'replyOne' ,
385+ requestTwo : 'replyTwo'
386+ } ) ;
384387 } ) ;
385388 } ) ;
386389
@@ -468,9 +471,12 @@ describe('Requests:', function() {
468471 . and . calledWith ( 'requestTwo' , 'argOne' , 'argTwo' ) ;
469472 } ) ;
470473
471- it ( 'should return an array of replies' , function ( ) {
474+ it ( 'should return an object of replies' , function ( ) {
472475 expect ( this . Requests . request )
473- . to . have . returned ( [ 'replyOne' , 'replyTwo' ] ) ;
476+ . to . have . returned ( {
477+ requestOne : 'replyOne' ,
478+ requestTwo : 'replyTwo'
479+ } ) ;
474480 } ) ;
475481 } ) ;
476482
@@ -532,9 +538,39 @@ describe('Requests:', function() {
532538 . and . calledWith ( 'requestThree' , 'argTwo' ) ;
533539 } ) ;
534540
535- it ( 'should return an array of replies' , function ( ) {
541+ it ( 'should return an object of replies' , function ( ) {
536542 expect ( this . Requests . request )
537- . to . have . returned ( [ 'replyOne' , 'replyTwo' , 'replyThree' ] ) ;
543+ . to . have . returned ( {
544+ requestOne : 'replyOne' ,
545+ requestTwo : 'replyTwo' ,
546+ requestThree : 'replyThree'
547+ } ) ;
548+ } ) ;
549+ } ) ;
550+
551+ describe ( 'when calling `request` with object with space-separated keys of requests with matching with matching keys' , function ( ) {
552+ beforeEach ( function ( ) {
553+ this . Requests . reply ( 'requestOne requestTwo' , _ . identity ) ;
554+ this . Requests . request ( {
555+ 'requestOne requestTwo' : 'argOne' ,
556+ 'requestTwo' : 'argTwo'
557+ } ) ;
558+ } ) ;
559+
560+ it ( 'should call the set of requests' , function ( ) {
561+ expect ( this . Requests . request )
562+ . to . have . callCount ( 5 )
563+ . and . calledWith ( 'requestOne' , 'argOne' )
564+ . and . calledWith ( 'requestTwo' , 'argOne' )
565+ . and . calledWith ( 'requestTwo' , 'argTwo' ) ;
566+ } ) ;
567+
568+ it ( 'should return an object of replies override duplicate keys' , function ( ) {
569+ expect ( this . Requests . request )
570+ . to . have . returned ( {
571+ requestOne : 'argOne' ,
572+ requestTwo : 'argTwo'
573+ } ) ;
538574 } ) ;
539575 } ) ;
540576} ) ;
0 commit comments