"code.cloudfoundry.org/lager"

	"github.com/cloudfoundry-incubator/consul-release/src/confab/chaperon"
	"github.com/cloudfoundry-incubator/consul-release/src/confab/fakes"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/pivotal-cf-experimental/gomegamatchers"
)

var _ = Describe("KeyringRemover", func() {
	Describe("Execute", func() {
		var (
			dataDir string
			keyring string
			logger  *fakes.Logger
			remover chaperon.KeyringRemover
		)

		BeforeEach(func() {
			var err error
			dataDir, err = ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())

			file, err := ioutil.TempFile(dataDir, "keyring")
			Expect(err).NotTo(HaveOccurred())
			defer file.Close()
			keyring = file.Name()

			logger = &fakes.Logger{}
	"code.cloudfoundry.org/lager"

	"github.com/cloudfoundry-incubator/consul-release/src/confab/chaperon"
	"github.com/cloudfoundry-incubator/consul-release/src/confab/config"
	"github.com/cloudfoundry-incubator/consul-release/src/confab/fakes"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/pivotal-cf-experimental/gomegamatchers"
)

var _ = Describe("ConfigWriter", func() {
	var (
		configDir string
		dataDir   string
		cfg       config.Config
		writer    chaperon.ConfigWriter
		logger    *fakes.Logger
	)

	Describe("Write", func() {
		BeforeEach(func() {
			logger = &fakes.Logger{}

			var err error
			configDir, err = ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())

			dataDir, err = ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())