group.Name = "a-security-group-name" fakeSecurityGroupRepo.ReadReturns.SecurityGroup = group }) JustBeforeEach(func() { runCommand("a-security-group-name") }) It("removes the group from the default staging group set", func() { Expect(ui.Outputs).To(ContainSubstrings( []string{"Removing", "security group", "a-security-group-name", "my-user"}, []string{"OK"}, )) Expect(fakeSecurityGroupRepo.ReadCalledWith.Name).To(Equal("a-security-group-name")) Expect(fakeStagingSecurityGroupsRepo.RemoveFromDefaultStagingSetArgsForCall(0)).To(Equal("just-pretend-this-is-a-guid")) }) }) Context("when the security group does not exist", func() { BeforeEach(func() { fakeSecurityGroupRepo.ReadReturns.Error = errors.NewModelNotFoundError("security group", "anana-qui-parle") }) It("warns the user", func() { runCommand("anana-qui-parle") Expect(ui.WarnOutputs).To(ContainSubstrings( []string{"Security group", "anana-qui-parle", "does not exist"}, )) Expect(ui.Outputs).To(ContainSubstrings(