Skip to content

Commit

Permalink
New test for Walk case w/ except
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSgrash committed Feb 28, 2022
1 parent b6a5eb7 commit 84d760b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions processor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,29 @@ var _ = Describe("Processor", func() {
Expect(len(mergeOpts.Files)).To(Equal(5))
})
})

Context("'In' in combination with 'subdirs' and 'except'", func() {
It("should run a merge for each file in the directory specified in 'for_each.in' and its subdirs, except those specified in 'except'.. its even more complicated", func() {
cfg.Merge[0].With.Files = []string{"fake1", "fake2"}
cfg.ForEach.In = "integration/yamls/addons/"
cfg.ForEach.SubDirs = true
cfg.ForEach.Except = "fake2"
cfg.ForEach.ForAll = "integration/yamls/"

spruceConfig = []aviator.Spruce{cfg}
spruceClient = new(fakes.FakeSpruceClient)
processor = NewTestProcessor(spruceClient, store, modifier)

err := processor.ProcessSilent(spruceConfig)
Expect(err).ToNot(HaveOccurred())

cc := spruceClient.MergeWithOptsCallCount()
Expect(cc).To(Equal(8))

mergeOpts := spruceClient.MergeWithOptsArgsForCall(0)
Expect(len(mergeOpts.Files)).To(Equal(4))
})
})
})
})
})
Expand Down

0 comments on commit 84d760b

Please sign in to comment.