Prevent further use of SetPrepareCmd and InitCmdStubber
This commit is contained in:
parent
5531498f27
commit
c308f1cd91
11 changed files with 56 additions and 2 deletions
|
|
@ -1,3 +1,8 @@
|
|||
linters:
|
||||
enable:
|
||||
gofmt
|
||||
- gofmt
|
||||
- nolintlint
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ var PrepareCmd = func(cmd *exec.Cmd) Runnable {
|
|||
return &cmdWithStderr{cmd}
|
||||
}
|
||||
|
||||
// SetPrepareCmd overrides PrepareCmd and returns a func to revert it back
|
||||
// Deprecated: use Stub
|
||||
func SetPrepareCmd(fn func(*exec.Cmd) Runnable) func() {
|
||||
origPrepare := PrepareCmd
|
||||
PrepareCmd = func(cmd *exec.Cmd) Runnable {
|
||||
|
|
|
|||
|
|
@ -294,6 +294,7 @@ func TestIssueCreate_continueInBrowser(t *testing.T) {
|
|||
})
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -422,6 +423,7 @@ func TestIssueCreate_web(t *testing.T) {
|
|||
defer http.Verify(t)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -447,6 +449,7 @@ func TestIssueCreate_webTitleBody(t *testing.T) {
|
|||
defer http.Verify(t)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ func TestIssueList_web(t *testing.T) {
|
|||
defer http.Verify(t)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ func TestIssueView_web(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -110,6 +111,7 @@ func TestIssueView_web_numberArgWithHash(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -281,6 +283,7 @@ func TestIssueView_web_notFound(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -332,6 +335,7 @@ func TestIssueView_web_urlArg(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ func TestPRCheckout_sameRepo(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -162,6 +163,7 @@ func TestPRCheckout_urlArg(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -201,6 +203,7 @@ func TestPRCheckout_urlArg_differentBase(t *testing.T) {
|
|||
http.StubRepoInfoResponse("OWNER", "REPO", "master")
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -253,6 +256,7 @@ func TestPRCheckout_branchArg(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -292,6 +296,7 @@ func TestPRCheckout_existingBranch(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -344,6 +349,7 @@ func TestPRCheckout_differentRepo_remoteExists(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
@ -386,6 +392,7 @@ func TestPRCheckout_differentRepo(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git config branch.feature.merge":
|
||||
|
|
@ -428,6 +435,7 @@ func TestPRCheckout_differentRepo_existingBranch(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git config branch.feature.merge":
|
||||
|
|
@ -468,6 +476,7 @@ func TestPRCheckout_detachedHead(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git config branch.feature.merge":
|
||||
|
|
@ -508,6 +517,7 @@ func TestPRCheckout_differentRepo_currentBranch(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git config branch.feature.merge":
|
||||
|
|
@ -547,6 +557,7 @@ func TestPRCheckout_differentRepo_invalidBranchName(t *testing.T) {
|
|||
} } } }
|
||||
`))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
t.Errorf("unexpected external invocation: %v", cmd.Args)
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -580,6 +591,7 @@ func TestPRCheckout_maintainerCanModify(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git config branch.feature.merge":
|
||||
|
|
@ -621,6 +633,7 @@ func TestPRCheckout_recurseSubmodules(t *testing.T) {
|
|||
`))
|
||||
|
||||
ranCommands := [][]string{}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case "git show-ref --verify -- refs/heads/feature":
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ func TestPRCreate_nontty_web(t *testing.T) {
|
|||
|
||||
http.StubRepoInfoResponse("OWNER", "REPO", "master")
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -178,6 +179,7 @@ func TestPRCreate_recover(t *testing.T) {
|
|||
assert.Equal(t, "recovered body", input["body"].(string))
|
||||
}))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -254,6 +256,7 @@ func TestPRCreate_nontty(t *testing.T) {
|
|||
}),
|
||||
)
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -296,6 +299,7 @@ func TestPRCreate(t *testing.T) {
|
|||
assert.Equal(t, "feature", input["headRefName"].(string))
|
||||
}))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -351,6 +355,7 @@ func TestPRCreate_createFork(t *testing.T) {
|
|||
assert.Equal(t, "monalisa:feature", input["headRefName"].(string))
|
||||
}))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -502,6 +507,7 @@ func TestPRCreate_nonLegacyTemplate(t *testing.T) {
|
|||
assert.Equal(t, "- commit 1\n- commit 0\n\nFixes a bug and Closes an issue", input["body"].(string))
|
||||
}))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -635,6 +641,7 @@ func TestPRCreate_metadata(t *testing.T) {
|
|||
eq(t, inputs["union"], true)
|
||||
}))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -662,6 +669,7 @@ func TestPRCreate_alreadyExists(t *testing.T) {
|
|||
] } } } }`),
|
||||
)
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -688,6 +696,7 @@ func TestPRCreate_web(t *testing.T) {
|
|||
httpmock.GraphQL(`query UserCurrent\b`),
|
||||
httpmock.StringResponse(`{"data": {"viewer": {"login": "OWNER"} } }`))
|
||||
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -715,6 +724,7 @@ func TestPRCreate_web(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_determineTrackingBranch_empty(t *testing.T) {
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -730,6 +740,7 @@ func Test_determineTrackingBranch_empty(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_determineTrackingBranch_noMatch(t *testing.T) {
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -755,6 +766,7 @@ deadb00f refs/remotes/origin/feature`) // git show-ref --verify (ShowRefs)
|
|||
}
|
||||
|
||||
func Test_determineTrackingBranch_hasMatch(t *testing.T) {
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
@ -786,6 +798,7 @@ deadbeef refs/remotes/upstream/feature`) // git show-ref --verify (ShowRefs)
|
|||
}
|
||||
|
||||
func Test_determineTrackingBranch_respectTrackingConfig(t *testing.T) {
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
cs, cmdTeardown := test.InitCmdStubber()
|
||||
defer cmdTeardown()
|
||||
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ func TestPRList_web(t *testing.T) {
|
|||
defer http.Verify(t)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -494,6 +494,7 @@ func TestPRView_web_currentBranch(t *testing.T) {
|
|||
http.Register(httpmock.GraphQL(`query PullRequestForBranch\b`), httpmock.FileResponse("./fixtures/prView.json"))
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case `git config --get-regexp ^branch\.blueberries\.(remote|merge)$`:
|
||||
|
|
@ -528,6 +529,7 @@ func TestPRView_web_noResultsForBranch(t *testing.T) {
|
|||
http.Register(httpmock.GraphQL(`query PullRequestForBranch\b`), httpmock.FileResponse("./fixtures/prView_NoActiveBranch.json"))
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
switch strings.Join(cmd.Args, " ") {
|
||||
case `git config --get-regexp ^branch\.blueberries\.(remote|merge)$`:
|
||||
|
|
@ -562,6 +564,7 @@ func TestPRView_web_numberArg(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -595,6 +598,7 @@ func TestPRView_web_numberArgWithHash(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -628,6 +632,7 @@ func TestPRView_web_urlArg(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -663,6 +668,7 @@ func TestPRView_web_branchArg(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -699,6 +705,7 @@ func TestPRView_web_branchWithOwnerArg(t *testing.T) {
|
|||
)
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ func TestRepoCreate(t *testing.T) {
|
|||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -170,6 +171,7 @@ func TestRepoCreate_outsideGitWorkDir(t *testing.T) {
|
|||
{},
|
||||
{},
|
||||
}
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
if len(cmdOutputs) == 0 {
|
||||
t.Fatal("Too many calls to git command")
|
||||
|
|
@ -244,6 +246,7 @@ func TestRepoCreate_org(t *testing.T) {
|
|||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -326,6 +329,7 @@ func TestRepoCreate_orgWithTeam(t *testing.T) {
|
|||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -409,6 +413,7 @@ func TestRepoCreate_template(t *testing.T) {
|
|||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
@ -489,6 +494,7 @@ func TestRepoCreate_withoutNameArg(t *testing.T) {
|
|||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
var seenCmd *exec.Cmd
|
||||
//nolint:staticcheck // SA1019 TODO: rewrite to use run.Stub
|
||||
restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable {
|
||||
seenCmd = cmd
|
||||
return &test.OutputStub{}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ type CmdStubber struct {
|
|||
Calls []*exec.Cmd
|
||||
}
|
||||
|
||||
// Deprecated: use run.Stub
|
||||
func InitCmdStubber() (*CmdStubber, func()) {
|
||||
cs := CmdStubber{}
|
||||
teardown := run.SetPrepareCmd(createStubbedPrepareCmd(&cs))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue