@@ -35,7 +35,7 @@ func TestGenerate(t *testing.T) {
3535 name : "basic" ,
3636 baseDir : "fixtures/multifile" ,
3737 g : & Generator {
38- UseGoRun : false ,
38+ ExecMode : ExecModeDirect ,
3939 DryRun : false ,
4040 MockSetName : "MockInterfaces" ,
4141 RestArgs : []string {"-package" , "mock_multifile" , "-destination" , "mock_multifile/mock.go" },
@@ -47,19 +47,31 @@ func TestGenerate(t *testing.T) {
4747 name : "with go run" ,
4848 baseDir : "fixtures/multifile" ,
4949 g : & Generator {
50- UseGoRun : true ,
50+ ExecMode : ExecModeGoRun ,
5151 DryRun : false ,
5252 MockSetName : "MockInterfaces" ,
5353 RestArgs : []string {"-package" , "mock_multifile" , "-destination" , "mock_multifile/mock.go" },
5454 },
5555 wantCmdExecutable : "go" ,
5656 wantCmdArgs : []string {"run" , "go.uber.org/mock/mockgen" , "-package" , "mock_multifile" , "-destination" , "mock_multifile/mock.go" , "." , "IFoo,IBar" },
5757 },
58+ {
59+ name : "with go tool" ,
60+ baseDir : "fixtures/multifile" ,
61+ g : & Generator {
62+ ExecMode : ExecModeGoTool ,
63+ DryRun : false ,
64+ MockSetName : "MockInterfaces" ,
65+ RestArgs : []string {"-package" , "mock_multifile" , "-destination" , "mock_multifile/mock.go" },
66+ },
67+ wantCmdExecutable : "go" ,
68+ wantCmdArgs : []string {"tool" , "go.uber.org/mock/mockgen" , "-package" , "mock_multifile" , "-destination" , "mock_multifile/mock.go" , "." , "IFoo,IBar" },
69+ },
5870 {
5971 name : "with external package" ,
6072 baseDir : "fixtures/external" ,
6173 g : & Generator {
62- UseGoRun : false ,
74+ ExecMode : ExecModeDirect ,
6375 DryRun : false ,
6476 MockSetName : "MockInterfaces" ,
6577 RestArgs : []string {"-package" , "mock_sql" , "-destination" , "mock_sql/mock.go" },
0 commit comments