mirror of
https://github.com/alexellis/arkade.git
synced 2022-05-07 18:22:49 +03:00
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>
33 lines
651 B
Go
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)
|
|
}
|
|
}
|
|
}
|