2016-10-24 13:57:17 -04:00
|
|
|
/*
|
2018-08-24 15:03:55 -04:00
|
|
|
Copyright The Helm Authors.
|
2016-10-24 13:57:17 -04:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-02-24 10:11:54 -05:00
|
|
|
package cmd
|
2016-10-24 13:57:17 -04:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestVersion(t *testing.T) {
|
2018-05-14 12:23:21 -04:00
|
|
|
tests := []cmdTestCase{{
|
2018-05-09 11:37:20 -04:00
|
|
|
name: "default",
|
|
|
|
|
cmd: "version",
|
|
|
|
|
golden: "output/version.txt",
|
2019-06-10 18:05:21 -04:00
|
|
|
}, {
|
|
|
|
|
name: "short",
|
|
|
|
|
cmd: "version --short",
|
|
|
|
|
golden: "output/version-short.txt",
|
2018-05-09 11:37:20 -04:00
|
|
|
}, {
|
|
|
|
|
name: "template",
|
|
|
|
|
cmd: "version --template='Version: {{.Version}}'",
|
|
|
|
|
golden: "output/version-template.txt",
|
|
|
|
|
}}
|
2018-05-14 12:23:21 -04:00
|
|
|
runTestCmd(t, tests)
|
2016-10-24 13:57:17 -04:00
|
|
|
}
|
2020-08-08 03:43:34 -04:00
|
|
|
|
|
|
|
|
func TestVersionFileCompletion(t *testing.T) {
|
|
|
|
|
checkFileCompletion(t, "version", false)
|
|
|
|
|
}
|