Skip to content

Commit

Permalink
fix: keep the API: postrender.NewExec and Add NewExecWithArgs
Browse files Browse the repository at this point in the history
Signed-off-by: guofutan <guofutan@tencent.com>
  • Loading branch information
guofutan committed Jan 22, 2022
1 parent 1aab7eb commit 44423fb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pkg/postrender/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,24 @@ func TestExecRun(t *testing.T) {
testpath, cleanup := setupTestingScript(t)
defer cleanup()

renderer, err := NewExec(testpath, []string{})
renderer, err := NewExec(testpath)
require.NoError(t, err)

output, err := renderer.Run(bytes.NewBufferString("FOOTEST"))
is.NoError(err)
is.Contains(output.String(), "BARTEST")
}

func TestNewExecWithArgsRun(t *testing.T) {
if runtime.GOOS == "windows" {
// the actual Run test uses a basic sed example, so skip this test on windows
t.Skip("skipping on windows")
}
is := assert.New(t)
testpath, cleanup := setupTestingScript(t)
defer cleanup()

renderer, err := NewExecWithArgs(testpath, []string{})
require.NoError(t, err)

output, err := renderer.Run(bytes.NewBufferString("FOOTEST"))
Expand Down

0 comments on commit 44423fb

Please sign in to comment.