import (
	"errors"

	"github.com/cloudfoundry-incubator/ducati-daemon/container"
	"github.com/cloudfoundry-incubator/ducati-daemon/executor/commands"
	"github.com/cloudfoundry-incubator/ducati-daemon/fakes"
	"github.com/cloudfoundry-incubator/ducati-daemon/lib/namespace"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Delete", func() {
	var (
		deletor         container.Deletor
		executor        *fakes.Executor
		containerNS     namespace.Namespace
		namespaceOpener *fakes.Opener
	)

	BeforeEach(func() {
		executor = &fakes.Executor{}

		namespaceOpener = &fakes.Opener{}
		containerNS = &fakes.Namespace{NameStub: func() string { return "container ns sentinel" }}
		namespaceOpener.OpenPathReturns(containerNS, nil)

		deletor = container.Deletor{
			Executor:        executor,
			NamespaceOpener: namespaceOpener,
		}
	})
	"github.com/cloudfoundry-incubator/ducati-daemon/fakes"
	"github.com/cloudfoundry-incubator/ducati-daemon/models"
	"github.com/cloudfoundry-incubator/ducati-daemon/watcher"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Creator", func() {
	var (
		creator         container.Creator
		ex              *fakes.Executor
		containerMAC    net.HardwareAddr
		containerNS     *fakes.Namespace
		ipamResult      *types.Result
		config          container.CreatorConfig
		sandbox         *fakes.Sandbox
		sandboxRepo     *fakes.SandboxRepository
		sandboxNS       *fakes.Namespace
		missWatcher     watcher.MissWatcher
		commandBuilder  *fakes.CommandBuilder
		namespaceOpener *fakes.Opener
	)

	BeforeEach(func() {
		ex = &fakes.Executor{}
		sandbox = &fakes.Sandbox{}
		sandboxRepo = &fakes.SandboxRepository{}
		missWatcher = &fakes.MissWatcher{}
		commandBuilder = &fakes.CommandBuilder{}
		containerNS = &fakes.Namespace{NameStub: func() string { return "container ns sentinel" }}
		namespaceOpener = &fakes.Opener{}