}) }) Context("when there are no router groups", func() { It("tells the user when no router groups were found", func() { runCommand() Expect(ui.Outputs).To(ContainSubstrings( []string{"Getting router groups"}, []string{"No router groups found"}, )) }) }) Context("when there is an error listing router groups", func() { BeforeEach(func() { routingApiRepo.ListError = true }) It("returns an error to the user", func() { runCommand() Expect(ui.Outputs).To(ContainSubstrings( []string{"Getting router groups"}, []string{"Failed fetching router groups"}, )) }) }) })