}) JustBeforeEach(func() { templates = tpl.New(tmpDir, osName) }) AfterEach(func() { os.RemoveAll(tmpDir) }) Context("Windows2012r2", func() { BeforeEach(func() { osName = "windows2012r2" }) Describe("Autounattend.xml.template root template", func() { var rootTemplate tpl.Templater JustBeforeEach(func() { rootTemplate = templates.FindTemplate(filepath.Join(tmpDir, "Autounattend.xml.template")) }) It("should be found", func() { Expect(rootTemplate).ToNot(BeNil()) }) It("should have 2 partial templates", func() { Expect(rootTemplate.ListTemplates()).To(HaveLen(2)) }) It("should include Autounattend.xml.oobe.partial", func() { path := filepath.Join(tmpDir, "Autounattend.xml.oobe.partial") Expect(rootTemplate.FindTemplate(path)).ToNot(BeNil()) }) It("should include Autounattend.xml.disks.partial", func() { path := filepath.Join(tmpDir, "Autounattend.xml.disks.partial") Expect(rootTemplate.FindTemplate(path)).ToNot(BeNil()) })