コード例 #1
0
ファイル: delete_test.go プロジェクト: nota-ja/cli
					}
				})

				Context("when the -r flag is provided", func() {
					Context("when deleting routes succeeds", func() {
						It("deletes the app's routes", func() {
							runCommand("-f", "-r", "app-to-delete")

							Expect(routeRepo.DeletedRouteGuids).To(ContainElement("the-first-route-guid"))
							Expect(routeRepo.DeletedRouteGuids).To(ContainElement("the-second-route-guid"))
						})
					})

					Context("when deleting routes fails", func() {
						BeforeEach(func() {
							routeRepo.DeleteErr = errors.New("badness")
						})

						It("fails with the api error message", func() {
							runCommand("-f", "-r", "app-to-delete")

							testassert.SliceContains(ui.Outputs, testassert.Lines{
								{"Deleting", "app-to-delete"},
								{"FAILED"},
							})
						})
					})
				})

				Context("when the -r flag is not provided", func() {
					It("does not delete mapped routes", func() {