}) Describe("Start", func() { var tmpdir string BeforeEach(func() { var err error tmpdir, err = ioutil.TempDir(os.TempDir(), "garden-server-test") Expect(err).ToNot(HaveOccurred()) snapshotsPath = path.Join(tmpdir, "snapshots") }) It("creates the snapshots directory if it's not already there", func() { err := linuxBackend.Start() Expect(err).ToNot(HaveOccurred()) stat, err := os.Stat(snapshotsPath) Expect(err).ToNot(HaveOccurred()) Expect(stat.IsDir()).To(BeTrue()) }) Context("when the snapshots directory fails to be created", func() { BeforeEach(func() { tmpfile, err := ioutil.TempFile(os.TempDir(), "garden-server-test") Expect(err).ToNot(HaveOccurred()) snapshotsPath = path.Join(tmpfile.Name(), "snapshots") })