summaryrefslogtreecommitdiff
path: root/gomplate_test.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2021-01-17 15:46:57 -0500
committerDave Henderson <dhenderson@gmail.com>2021-01-17 16:48:48 -0500
commitd6c72218477357bc855f700ca6134d40cd96adf0 (patch)
tree0eb5a3f593fde1aafac6988aafe5ffbe197c2568 /gomplate_test.go
parent5835d0d688525716be902297193f78227994f5bf (diff)
Inject stdin/out/err instead of always using os.Stdin/out/err
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'gomplate_test.go')
-rw-r--r--gomplate_test.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/gomplate_test.go b/gomplate_test.go
index 1d569958..797eb87e 100644
--- a/gomplate_test.go
+++ b/gomplate_test.go
@@ -16,7 +16,6 @@ import (
"github.com/hairyhenderson/gomplate/v3/conv"
"github.com/hairyhenderson/gomplate/v3/data"
"github.com/hairyhenderson/gomplate/v3/env"
- "github.com/hairyhenderson/gomplate/v3/internal/iohelpers"
"github.com/stretchr/testify/assert"
)
@@ -156,10 +155,8 @@ func TestCustomDelim(t *testing.T) {
}
func TestRunTemplates(t *testing.T) {
- defer func() { Stdout = os.Stdout }()
buf := &bytes.Buffer{}
- Stdout = &iohelpers.NopCloser{Writer: buf}
- config := &Config{Input: "foo", OutputFiles: []string{"-"}}
+ config := &Config{Input: "foo", OutputFiles: []string{"-"}, Out: buf}
err := RunTemplates(config)
assert.NoError(t, err)
assert.Equal(t, "foo", buf.String())