@@ -29,37 +29,37 @@ func TestMockClientImplementation(t *testing.T) {
2929 t .Run ("Clone" , func (t * testing.T ) {
3030 t .Run ("success case" , func (t * testing.T ) {
3131 mock := NewMockClient ()
32- mock .On ("Clone" , ctx , "https://github.com/test/repo.git" , "/tmp/repo" ).Return (nil )
32+ mock .On ("Clone" , ctx , "https://github.com/test/repo.git" , "/tmp/repo" , ( * CloneOptions )( nil ) ).Return (nil )
3333
34- err := mock .Clone (ctx , "https://github.com/test/repo.git" , "/tmp/repo" )
34+ err := mock .Clone (ctx , "https://github.com/test/repo.git" , "/tmp/repo" , nil )
3535 require .NoError (t , err )
3636 mock .AssertExpectations (t )
3737 })
3838
3939 t .Run ("error case" , func (t * testing.T ) {
4040 mock := NewMockClient ()
41- mock .On ("Clone" , ctx , "https://github.com/test/repo.git" , "/tmp/repo" ).Return (errCloneFailed )
41+ mock .On ("Clone" , ctx , "https://github.com/test/repo.git" , "/tmp/repo" , ( * CloneOptions )( nil ) ).Return (errCloneFailed )
4242
43- err := mock .Clone (ctx , "https://github.com/test/repo.git" , "/tmp/repo" )
43+ err := mock .Clone (ctx , "https://github.com/test/repo.git" , "/tmp/repo" , nil )
4444 require .Error (t , err )
4545 require .Equal (t , errCloneFailed , err )
4646 mock .AssertExpectations (t )
4747 })
4848
4949 t .Run ("improperly configured mock" , func (t * testing.T ) {
5050 mock := NewMockClient ()
51- mock .On ("Clone" , ctx , "url" , "path" ).Return ()
51+ mock .On ("Clone" , ctx , "url" , "path" , ( * CloneOptions )( nil ) ).Return ()
5252
53- err := mock .Clone (ctx , "url" , "path" )
53+ err := mock .Clone (ctx , "url" , "path" , nil )
5454 require .Error (t , err )
5555 require .Contains (t , err .Error (), "mock not properly configured" )
5656 })
5757
5858 t .Run ("mock returns non-error type" , func (t * testing.T ) {
5959 mock := NewMockClient ()
60- mock .On ("Clone" , ctx , "url" , "path" ).Return ("not an error" )
60+ mock .On ("Clone" , ctx , "url" , "path" , ( * CloneOptions )( nil ) ).Return ("not an error" )
6161
62- err := mock .Clone (ctx , "url" , "path" )
62+ err := mock .Clone (ctx , "url" , "path" , nil )
6363 require .Error (t , err )
6464 require .Contains (t , err .Error (), "mock returned non-error type" )
6565 })
@@ -272,8 +272,8 @@ func TestMockClientDefensiveProgramming(t *testing.T) {
272272 mock := NewMockClient ()
273273
274274 // Test methods that return only error
275- mock .On ("Clone" , ctx , "url" , "path" ).Return (nil ).Once ()
276- err := mock .Clone (ctx , "url" , "path" )
275+ mock .On ("Clone" , ctx , "url" , "path" , ( * CloneOptions )( nil ) ).Return (nil ).Once ()
276+ err := mock .Clone (ctx , "url" , "path" , nil )
277277 require .NoError (t , err )
278278
279279 mock .On ("Checkout" , ctx , "repo" , "branch" ).Return (nil ).Once ()
@@ -322,7 +322,7 @@ func TestMockClientConcurrency(_ *testing.T) {
322322 mock := NewMockClient ()
323323
324324 // Set up expectations for concurrent calls
325- mock .On ("Clone" , ctx , "url" , "path" ).Return (nil ).Maybe ()
325+ mock .On ("Clone" , ctx , "url" , "path" , ( * CloneOptions )( nil ) ).Return (nil ).Maybe ()
326326 mock .On ("Checkout" , ctx , "repo" , "branch" ).Return (nil ).Maybe ()
327327 mock .On ("CreateBranch" , ctx , "repo" , "branch" ).Return (nil ).Maybe ()
328328 mock .On ("Add" , ctx , "repo" , []string {"file" }).Return (nil ).Maybe ()
@@ -338,7 +338,7 @@ func TestMockClientConcurrency(_ *testing.T) {
338338 // Launch goroutines for each method
339339 go func () {
340340 for i := 0 ; i < 10 ; i ++ {
341- _ = mock .Clone (ctx , "url" , "path" )
341+ _ = mock .Clone (ctx , "url" , "path" , nil )
342342 }
343343 done <- true
344344 }()
0 commit comments