-
Notifications
You must be signed in to change notification settings - Fork 234
/
completion_test.go
32 lines (27 loc) · 1.01 KB
/
completion_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"testing"
coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests"
"github.com/jfrog/jfrog-cli/completion/shells/bash"
"github.com/jfrog/jfrog-cli/completion/shells/zsh"
"github.com/jfrog/jfrog-cli/utils/tests"
"github.com/stretchr/testify/assert"
)
func TestBashCompletion(t *testing.T) {
jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "")
content, err := tests.GetCmdOutput(t, jfrogCli, "completion", "bash")
assert.NoError(t, err)
assert.Equal(t, bash.BashAutocomplete, string(content))
}
func TestZshCompletion(t *testing.T) {
jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "")
content, err := tests.GetCmdOutput(t, jfrogCli, "completion", "zsh")
assert.NoError(t, err)
assert.Equal(t, zsh.ZshAutocomplete, string(content))
}
func TestFishCompletion(t *testing.T) {
jfrogCli := coreTests.NewJfrogCli(execMain, "jfrog", "")
content, err := tests.GetCmdOutput(t, jfrogCli, "completion", "fish")
assert.NoError(t, err)
assert.Contains(t, string(content), "complete -c")
}