forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
completion_test.go
31 lines (26 loc) · 960 Bytes
/
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
package main
import (
"testing"
"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 := tests.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 := tests.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 := tests.NewJfrogCli(execMain, "jfrog", "")
content, err := tests.GetCmdOutput(t, jfrogCli, "completion", "fish")
assert.NoError(t, err)
assert.Contains(t, string(content), "complete -c")
}