cmd.Flags().StringVarP(varRef,outputFlag,"o",string(outputTable),fmt.Sprintf("Prints the output in the specified format. Allowed values: %s, %s, %s",outputTable,outputJSON,outputYAML))
name:"search for 'maria', expect one match output json",
args:[]string{"maria"},
flags:strings.Split("--output json"," "),
expected:regexp.QuoteMeta(`{"Charts":[{"Name":"testing/mariadb","Version":"0.3.0","AppVersion":"","Description":"Chart for MariaDB"}]}`),
expected:`[{"Name":"testing/mariadb","Version":"0.3.0","Appversion":"","Description":"Chart for MariaDB"}]`,
},
{
name:"search for 'alpine', expect two matches output json",
args:[]string{"alpine"},
flags:strings.Split("--output json"," "),
expected:regexp.QuoteMeta(`{"Charts":[{"Name":"testing/alpine","Version":"0.2.0","AppVersion":"2.3.4","Description":"Deploy a basic Alpine Linux pod"}]}`),
expected:`[{"Name":"testing/alpine","Version":"0.2.0","Appversion":"2.3.4","Description":"Deploy a basic Alpine Linux pod"}]`,
},
{
name:"search for 'maria', expect one match output yaml",