@@ -142,6 +142,31 @@ describe('$interval', function() {
142142 } ) ) ;
143143
144144
145+ it ( 'should allow you to specify a number of arguments' , inject ( function ( $interval , $window ) {
146+ var task1 = jasmine . createSpy ( 'task1' ) ,
147+ task2 = jasmine . createSpy ( 'task2' ) ,
148+ task3 = jasmine . createSpy ( 'task3' ) ;
149+ $interval ( task1 , 1000 , 2 , true , 'Task1' ) ;
150+ $interval ( task2 , 1000 , 2 , true , 'Task2' ) ;
151+ $interval ( task3 , 1000 , 2 , true , 'I' , 'am' , 'a' , 'Task3' , 'spy' ) ;
152+
153+ $window . flush ( 1000 ) ;
154+ expect ( task1 ) . toHaveBeenCalledWith ( 'Task1' ) ;
155+ expect ( task2 ) . toHaveBeenCalledWith ( 'Task2' ) ;
156+ expect ( task3 ) . toHaveBeenCalledWith ( 'I' , 'am' , 'a' , 'Task3' , 'spy' ) ;
157+
158+ task1 . reset ( ) ;
159+ task2 . reset ( ) ;
160+ task3 . reset ( ) ;
161+
162+ $window . flush ( 1000 ) ;
163+ expect ( task1 ) . toHaveBeenCalledWith ( 'Task1' ) ;
164+ expect ( task2 ) . toHaveBeenCalledWith ( 'Task2' ) ;
165+ expect ( task3 ) . toHaveBeenCalledWith ( 'I' , 'am' , 'a' , 'Task3' , 'spy' ) ;
166+
167+ } ) ) ;
168+
169+
145170 it ( 'should return a promise which will be updated with the count on each iteration' ,
146171 inject ( function ( $interval , $window ) {
147172 var log = [ ] ,
0 commit comments