@@ -40,7 +40,7 @@ exports.constructor = function( test ){
4040exports . open = function ( test ) {
4141 var testRepo = new git . Repo ( ) ;
4242
43- test . expect ( 8 ) ;
43+ test . expect ( 7 ) ;
4444
4545 // Test for function
4646 helper . testFunction ( test . equals , testRepo . open , 'Repo::Open' ) ;
@@ -55,11 +55,6 @@ exports.open = function( test ) {
5555 testRepo . open ( "some/path" ) ;
5656 } , 'Throw an exception if no callback' ) ;
5757
58- // Test that both arguments result correctly
59- helper . testException ( test . ifError , function ( ) {
60- testRepo . open ( "some/path" , function ( ) { } ) ;
61- } , 'No exception is thrown which proper arguments' ) ;
62-
6358 // Test invalid repository
6459 testRepo . open ( '/etc/hosts' , function ( err , path ) {
6560 test . equals ( - 8 , err , 'Invalid repository error code' ) ;
@@ -93,19 +88,35 @@ exports.free = function( test ) {
9388exports . init = function ( test ) {
9489 var testRepo = new git . Repo ( ) ;
9590
96- test . expect ( 4 ) ;
91+ test . expect ( 8 ) ;
9792
9893 // Test for function
9994 helper . testFunction ( test . equals , testRepo . init , 'Repo::Init' ) ;
10095
96+ // Test path argument existence
97+ helper . testException ( test . ok , function ( ) {
98+ testRepo . init ( ) ;
99+ } , 'Throw an exception if no path' ) ;
100+
101+ // Test is_bare argument existence
102+ helper . testException ( test . ok , function ( ) {
103+ testRepo . init ( "some/path" ) ;
104+ } , 'Throw an exception if no is_bare' ) ;
105+
106+ // Test callback argument existence
107+ helper . testException ( test . ok , function ( ) {
108+ testRepo . init ( "some/path" , true ) ;
109+ } , 'Throw an exception if no callback' ) ;
110+
101111 // Cleanup, remove test repo directory - if it exists
102112 rimraf ( './test.git' , function ( ) {
103113 // Create bare repo and test for creation
104- testRepo . init ( './test.git' , true , function ( err , path ) {
114+ testRepo . init ( './test.git' , true , function ( err , path , is_bare ) {
105115 test . equals ( 0 , err , 'Successfully created bare repository' ) ;
106116 // Verify repo exists
107117 testRepo . open ( './test.git' , function ( err , path ) {
108118 test . equals ( 0 , err , 'Valid repository created' ) ;
119+ test . equals ( true , is_bare , 'Returns valid is_bare value' ) ;
109120 // Cleanup, remove test repo directory
110121 rimraf ( './test.git' , function ( ) {
111122 test . done ( ) ;
0 commit comments