aboutsummaryrefslogblamecommitdiffstats
path: root/commands/root_test.go
blob: aaf708c8df44e58f7cfb9e530ab16ad746186e2a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                   
                  
 


                     
                   


                       


                                             










                                                                     
                                                  


                                       

                




                                                                             
//go:build !windows
// +build !windows

package commands_test

import (
	"io/ioutil"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/require"
)

func requireGoldenFileEqual(t *testing.T, path string, act []byte) {
	t.Helper()

	path = filepath.Join("testdata", path)

	if *update {
		require.NoError(t, ioutil.WriteFile(path, act, 0644))
	}

	exp, err := ioutil.ReadFile(path)
	require.NoError(t, err)
	require.Equal(t, string(exp), string(act))
}

func TestNewRootCommand(t *testing.T) {
	t.Skip()

	testEnv := newTestEnv(t)
	testEnv.Execute(t)

	requireGoldenFileEqual(t, "root_out_golden.txt", testEnv.out.Bytes())
}