1
0
mirror of https://github.com/alexellis/arkade.git synced 2022-05-07 18:22:49 +03:00
Files
arkade-kubernetes/cmd/get_test.go
Alex Ellis (OpenFaaS Ltd) 10f4f5e0b2 Fix issue blocking use of Apple M1
Darwin passes in "arm64" as an architecture and not
aarch64 as assumed in the previous PR.

Also remove unwanted 386 arch given in the waypoint app.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-10-23 09:49:57 +01:00

33 lines
651 B
Go

package cmd
import (
"strings"
"testing"
)
func Test_GetCommandWithInvalidArch(t *testing.T) {
tests := []struct {
args []string
wantError string
}{
{
args: []string{"kind", "--arch", "invalid"},
wantError: "cpu architecture \"invalid\" is not supported",
},
{
args: []string{"kind", "--os", "invalid"},
wantError: "operating system \"invalid\" is not supported",
},
}
for _, tc := range tests {
cmd := MakeGet()
cmd.SetArgs(tc.args)
err := cmd.Execute()
if !strings.Contains(err.Error(), tc.wantError) {
t.Fatalf("for args %q\n want: %q\n but got: %q", tc.args, tc.wantError, err)
}
}
}