INNER CODE UNIT · Go
TestSubCommandFlags
cristianoliveira/ergo · main_test.go:586
func TestSubCommandFlags(t *testing.T) {
t.Run("setup", func(tt *testing.T) {
t.Run("when removing setup", func(tt *testing.T) {
args := []string{"ergo", "setup", "osx", "-remove"}
command, config := prepareSubCommand(args)
if command == nil || config == nil {
tt.Fatal("Expected result to not be nil")
}
setup := command.(commands.SetupCommand)
if !setup.Remove {
t.Error("Expected to have remove setup", setup)
}
if setup.System != "osx" {
t.Error("Expected to setup osx", setup)
}