err = os.RemoveAll(tmpPidfileDir)
		Expect(err).ToNot(HaveOccurred())

		err = os.RemoveAll(tmpLogDir)
		Expect(err).ToNot(HaveOccurred())
	})

	Context("When setup is successful", func() {
		It("creates the appropriate directories", func() {
			tmpInstanceDataDir := path.Join(tmpDataDir, instanceID)
			tmpInstanceLogDir := path.Join(tmpLogDir, instanceID)
			Expect(tmpInstanceDataDir).NotTo(BeADirectory())
			Expect(tmpInstanceLogDir).NotTo(BeADirectory())

			err := repo.Setup(&instance)
			Expect(err).NotTo(HaveOccurred())

			Expect(tmpInstanceDataDir).To(BeADirectory())
			Expect(tmpInstanceLogDir).To(BeADirectory())
		})

		It("creates a lock file", func() {
			err := repo.Setup(&instance)
			Expect(err).NotTo(HaveOccurred())

			lockFilePath := path.Join(tmpDataDir, instanceID, "lock")
			Expect(lockFilePath).To(BeAnExistingFile())
		})

		It("writes the config file", func() {