Ejemplo n.º 1
0
			desiredChangeCB func(models.DesiredLRPChange)
			desiredDeleteCB func(models.DesiredLRP)
			actualCreateCB  func(models.ActualLRP, bool)
			actualChangeCB  func(models.ActualLRPChange, bool)
			actualDeleteCB  func(models.ActualLRP, bool)
		)

		BeforeEach(func() {
			hub.RegisterCallbackStub = func(cb func(int)) {
				cb(1)
			}
			process = ifrit.Invoke(receptorWatcher)
			Eventually(bbs.WatchForDesiredLRPChangesCallCount).Should(Equal(1))
			Eventually(bbs.WatchForActualLRPChangesCallCount).Should(Equal(1))

			_, desiredCreateCB, desiredChangeCB, desiredDeleteCB = bbs.WatchForDesiredLRPChangesArgsForCall(0)
			_, actualCreateCB, actualChangeCB, actualDeleteCB = bbs.WatchForActualLRPChangesArgsForCall(0)
		})

		Describe("Desired LRP changes", func() {
			var desiredLRP models.DesiredLRP

			BeforeEach(func() {
				desiredLRP = models.DesiredLRP{
					Action: &models.RunAction{
						Path: "ls",
					},
					Domain:      "tests",
					ProcessGuid: expectedProcessGuid,
				}
			})