github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/environment/environment_test.go (about)

     1  package environment_test
     2  
     3  import (
     4  	"path/filepath"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  
     9  	_ "github.com/ActiveState/cli/internal/config"
    10  	"github.com/ActiveState/cli/internal/environment"
    11  )
    12  
    13  func TestGetRootPath(t *testing.T) {
    14  	rootPath, err := environment.GetRootPath()
    15  
    16  	if err != nil {
    17  		t.Fatal(err)
    18  	}
    19  
    20  	file := filepath.Join(rootPath, "internal/environment/environment_test.go")
    21  	require.FileExists(t, file)
    22  }