fix: execute valid bash cmd when running init as root

This commit is contained in:
Connor Edwards
2025-02-07 21:14:27 +00:00
parent 653f47f507
commit b2f7c6fb33
2 changed files with 41 additions and 10 deletions
+19
View File
@@ -0,0 +1,19 @@
package cli
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInstallCmd(t *testing.T) {
t.Run("root", func(t *testing.T) {
cmd := installCmd("root")
assert.NotContains(t, cmd, "sudo")
})
t.Run("nonroot", func(t *testing.T) {
cmd := installCmd("nonroot")
assert.Contains(t, cmd, "sudo")
})
}