コード例 #1
0
ファイル: analyzer_test.go プロジェクト: Zhann/hm9000
			startMessages, stopMessages, err := analyzer.Analyze()
			Ω(err).ShouldNot(HaveOccured())
			Ω(startMessages).Should(BeEmpty())
			Ω(stopMessages).Should(BeEmpty())
		})
	})

	Context("When /desired and /actual are empty", func() {
		BeforeEach(func() {
			desired := a1.DesiredState(42)
			actual := a2.GetInstance(0).Heartbeat(30)

			insertDesiredIntoStore(desired)
			insertActualIntoStore(actual)

			etcdStoreAdapter.Delete("/desired/" + desired.StoreKey())
			etcdStoreAdapter.Delete("/actual/" + actual.StoreKey())
		})

		It("Should not send any start or stop messages", func() {
			startMessages, stopMessages, err := analyzer.Analyze()
			Ω(err).ShouldNot(HaveOccured())
			Ω(startMessages).Should(BeEmpty())
			Ω(stopMessages).Should(BeEmpty())
		})
	})

	Context("where thare are desired instances and no running instances", func() {
		BeforeEach(func() {
			desired1 := a1.DesiredState(17)
			desired1.NumberOfInstances = 1