Extract the debug/namespace flags into run.Config [#67]
This is a general-purpose cleanup commit; every step except InitKube had the same six "add the --debug and --namespace flags if applicable" code.
This commit is contained in:
@@ -33,3 +33,16 @@ func (suite *ConfigTestSuite) TestNewConfig() {
|
||||
stderr: stderr,
|
||||
}, cfg)
|
||||
}
|
||||
|
||||
func (suite *ConfigTestSuite) TestGlobalFlags() {
|
||||
cfg := config{
|
||||
debug: true,
|
||||
namespace: "public",
|
||||
}
|
||||
flags := cfg.globalFlags()
|
||||
suite.Equal([]string{"--debug", "--namespace", "public"}, flags)
|
||||
|
||||
cfg = config{}
|
||||
flags = cfg.globalFlags()
|
||||
suite.Equal([]string{}, flags)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user