func (n *nothingChangedComparator) Compare(previousInputs []bftinput.Input, currentInput bftinput.Input) []bftexpectation.Expectation { expectations := []bftexpectation.Expectation{} for _, job := range currentInput.Jobs { if n.nothingChanged(job, currentInput, previousInputs) { expectations = append(expectations, bftexpectation.NewDebugLog(fmt.Sprintf("No instances to update for '%s'", job.Name))) } } return expectations }
Jobs: []bftinput.Job{ { Name: "foo-job", Networks: []bftinput.JobNetworkConfig{ { Name: "network-1", }, }, }, }, } }) It("returns debug log expectation", func() { expectations := nothingChangedComparator.Compare(previousInputs, currentInput) expectedDebugLogExpectation := bftexpectation.NewDebugLog("No instances to update for 'foo-job'") Expect(expectations).To(ContainElement(expectedDebugLogExpectation)) }) }) Context("when there are jobs that have different properties", func() { BeforeEach(func() { previousInputs = []bftinput.Input{ { Jobs: []bftinput.Job{ { Name: "foo-job", Networks: []bftinput.JobNetworkConfig{ { Name: "network-1", },