@@ -113,18 +113,36 @@ describe('Github.Repository', function() {
113113 } ) ;
114114 } ) ;
115115
116- it ( 'should list commits' , function ( done ) {
116+ it ( 'should list commits with no options' , function ( done ) {
117+ repo . getCommits ( null , function ( err , commits ) {
118+ should . not . exist ( err ) ;
119+ commits . should . be . instanceof ( Array ) ;
120+ commits . should . have . length . above ( 0 ) ;
121+ commits [ 0 ] . should . have . property ( 'commit' ) ;
122+ commits [ 0 ] . should . have . property ( 'author' ) ;
123+
124+ done ( ) ;
125+ } ) ;
126+ } ) ;
127+
128+ it ( 'should list commits with all options' , function ( done ) {
129+ var sinceDate = new Date ( 2015 , 0 , 1 ) ;
130+ var untilDate = new Date ( 2016 , 0 , 20 ) ;
117131 var options = {
118132 sha : 'master' ,
119- path : 'test'
133+ path : 'test' ,
134+ author : 'AurelioDeRosa' ,
135+ since : sinceDate ,
136+ until : untilDate
120137 } ;
121138
122139 repo . getCommits ( options , function ( err , commits ) {
123140 should . not . exist ( err ) ;
124141 commits . should . be . instanceof ( Array ) ;
125142 commits . should . have . length . above ( 0 ) ;
126143 commits [ 0 ] . should . have . property ( 'commit' ) ;
127- commits [ 0 ] . should . have . property ( 'author' ) ;
144+ commits [ 0 ] . should . have . deep . property ( 'author.login' , 'AurelioDeRosa' ) ;
145+ ( new Date ( commits [ 0 ] . commit . author . date ) ) . getTime ( ) . should . be . within ( sinceDate . getTime ( ) , untilDate . getTime ( ) ) ;
128146
129147 done ( ) ;
130148 } ) ;
0 commit comments