From 5e05dc9fb9ad3ada91466da64d20ffbf063ca93d Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 4 Feb 2023 15:03:03 -0500 Subject: replace afero module Signed-off-by: Dave Henderson --- internal/tests/integration/basic_test.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'internal/tests/integration/basic_test.go') diff --git a/internal/tests/integration/basic_test.go b/internal/tests/integration/basic_test.go index d3a1d369..e4cb046e 100644 --- a/internal/tests/integration/basic_test.go +++ b/internal/tests/integration/basic_test.go @@ -8,17 +8,19 @@ import ( "github.com/hairyhenderson/gomplate/v4/internal/iohelpers" "gotest.tools/v3/assert" "gotest.tools/v3/assert/cmp" - testfs "gotest.tools/v3/fs" + tfs "gotest.tools/v3/fs" ) -func setupBasicTest(t *testing.T) *testfs.Dir { - tmpDir := testfs.NewDir(t, "gomplate-inttests", - testfs.WithFile("one", "hi\n", testfs.WithMode(0640)), - testfs.WithFile("two", "hello\n"), - testfs.WithFile("broken", "", testfs.WithMode(0000)), - testfs.WithDir("subdir", - testfs.WithFile("f1", "first\n", testfs.WithMode(0640)), - testfs.WithFile("f2", "second\n"), +func setupBasicTest(t *testing.T) *tfs.Dir { + t.Helper() + + tmpDir := tfs.NewDir(t, "gomplate-inttests", + tfs.WithFile("one", "hi\n", tfs.WithMode(0o640)), + tfs.WithFile("two", "hello\n"), + tfs.WithFile("broken", "", tfs.WithMode(0o000)), + tfs.WithDir("subdir", + tfs.WithFile("f1", "first\n", tfs.WithMode(0o640)), + tfs.WithFile("f2", "second\n"), ), ) t.Cleanup(tmpDir.Remove) @@ -180,7 +182,7 @@ func TestBasic_EmptyOutputSuppression(t *testing.T) { assertSuccess(t, o, e, err, "") _, err = os.Stat(out) - assert.Equal(t, true, os.IsNotExist(err)) + assert.ErrorIs(t, err, fs.ErrNotExist) } func TestBasic_RoutesInputsToProperOutputsWithChmod(t *testing.T) { -- cgit v1.2.3