@@ -58,24 +58,24 @@ test("Repo API", function(t) {
5858
5959 t . test ( 'repo.read' , function ( q ) {
6060 repo . read ( 'master' , 'README.md' , function ( err , res ) {
61- q . ok ( res . indexOf ( '# Github.js' ) !== - 1 , true , 'Returned README' ) ;
61+ q . notEquals ( res . indexOf ( '# Github.js' ) , - 1 , 'Returned README' ) ;
6262 q . end ( ) ;
6363 } ) ;
6464 } ) ;
6565
6666 t . test ( 'repo.getCommit' , function ( q ) {
6767 repo . getCommit ( 'master' , '20fcff9129005d14cc97b9d59b8a3d37f4fb633b' , function ( err , commit ) {
6868 q . error ( err , 'get commit' + err ) ;
69- q . ok ( commit . message , 'v0.10.4' , 'Returned commit message.' ) ;
70- q . ok ( commit . author . date , '2015-03-20T17:01:42Z' , 'Got correct date.' ) ;
69+ q . equals ( commit . message , 'v0.10.4' , 'Returned commit message.' ) ;
70+ q . equals ( commit . author . date , '2015-03-20T17:01:42Z' , 'Got correct date.' ) ;
7171 q . end ( ) ;
7272 } ) ;
7373 } ) ;
7474
7575 t . test ( 'repo.getSha' , function ( q ) {
7676 repo . getSha ( 'master' , '.gitignore' , function ( err , sha ) {
7777 q . error ( err , 'get sha error: ' + err ) ;
78- q . ok ( sha , '153216eb946aedc51f4fe88a51008b4abcac5308' , 'Returned sha message.' ) ;
78+ q . equals ( sha , '153216eb946aedc51f4fe88a51008b4abcac5308' , 'Returned sha message.' ) ;
7979 q . end ( ) ;
8080 } ) ;
8181 } ) ;
@@ -191,6 +191,24 @@ test('Create Repo', function(t) {
191191 } ) ;
192192 } ) ;
193193
194+ t . test ( 'repo.writeAuthorAndCommitter' , function ( q ) {
195+ var options = {
196+ author : { name : 'Author Name' , email : 'author@example.com' } ,
197+ committer : { name : 'Committer Name' , email : 'committer@example.com' }
198+ } ;
199+ repo . write ( 'dev' , 'TEST.md' , 'THIS IS A TEST BY AUTHOR AND COMMITTER' , 'Updating' , options , function ( err , res ) {
200+ q . error ( err ) ;
201+ repo . getCommit ( 'dev' , res . commit . sha , function ( err , commit ) {
202+ q . error ( err ) ;
203+ q . equals ( commit . author . name , 'Author Name' , 'Got correct author name.' ) ;
204+ q . equals ( commit . author . email , 'author@example.com' , 'Got correct author email.' ) ;
205+ q . equals ( commit . committer . name , 'Committer Name' , 'Got correct committer name.' ) ;
206+ q . equals ( commit . committer . email , 'committer@example.com' , 'Got correct committer email.' ) ;
207+ q . end ( ) ;
208+ } ) ;
209+ } ) ;
210+ } ) ;
211+
194212 t . test ( 'repo.writeChinese' , function ( q ) {
195213 repo . write ( 'master' , '中文测试.md' , 'THIS IS A TEST' , 'Creating test' , function ( err ) {
196214 q . error ( err ) ;
@@ -248,4 +266,4 @@ test('Repo Returns commit errors correctly', function(t) {
248266 clearTimeout ( timeout ) ;
249267 t . end ( ) ;
250268 } ) ;
251- } ) ;
269+ } ) ;
0 commit comments