Exemplo n.º 1
0
				It("shows no debug output if not requested", func() {
					options.Debug = false
					client := firehose.NewClient("ACCESS_TOKEN", fakeFirehose.URL(), options, ui)
					client.Start()
					Expect(stdout).ToNot(ContainSubstring("WEBSOCKET REQUEST"))
					Expect(stdout).ToNot(ContainSubstring("WEBSOCKET RESPONSE"))
				})
				It("prints out log messages to the terminal", func() {
					client := firehose.NewClient("ACCESS_TOKEN", fakeFirehose.URL(), options, ui)
					client.Start()
					Expect(stdout).To(ContainSubstring("This is a very special test message"))
				})
				Context("in Interactive mode", func() {
					Context("and the user filters by type", func() {
						BeforeEach(func() {
							options.NoFilter = false
						})
						It("does not show log messages when user wants to see HttpStart", func() {
							stdin.Write([]byte{'2', '\n'})
							client := firehose.NewClient("ACCESS_TOKEN", fakeFirehose.URL(), options, ui)
							client.Start()
							Expect(stdout).ToNot(ContainSubstring("This is a very special test message"))
						})
						It("shows log messages when the user wants to see log messages", func() {
							stdin.Write([]byte{'5', '\n'})
							client := firehose.NewClient("ACCESS_TOKEN", fakeFirehose.URL(), options, ui)
							client.Start()
							Expect(stdout).To(ContainSubstring("This is a very special test message"))
						})
						It("shows all messages when user hits enter at filter prompt", func() {
							stdin.Write([]byte{'\n'})