repoName, tag = helpers.ParseDockerRef("baz/bot") Expect(repoName).To(Equal("baz/bot")) Expect(tag).To(Equal("latest")) }) }) Describe("FetchMetadata", func() { var registryHost string var repoName string var tag string var insecureRegistries []string var authConfig *registry.AuthConfig BeforeEach(func() { server = ghttp.NewServer() endpoint1 = ghttp.NewServer() endpoint2 = ghttp.NewServer() parts, _ := url.Parse(server.URL()) registryHost = parts.Host repoName = "" tag = "latest" insecureRegistries = []string{} authConfig = ®istry.AuthConfig{} }) Context("with an invalid host", func() { BeforeEach(func() {
"github.com/cloudfoundry-incubator/docker_app_lifecycle/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/codelocation" Failer "github.com/cloudfoundry-incubator/docker_app_lifecycle/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/failer" "github.com/cloudfoundry-incubator/docker_app_lifecycle/Godeps/_workspace/src/github.com/onsi/ginkgo/types" "time" ) var _ = Describe("SynchronizedBeforeSuiteNode", func() { var failer *Failer.Failer var node SuiteNode var codeLocation types.CodeLocation var innerCodeLocation types.CodeLocation var outcome bool var server *ghttp.Server BeforeEach(func() { server = ghttp.NewServer() codeLocation = codelocation.New(0) innerCodeLocation = codelocation.New(0) failer = Failer.New() }) AfterEach(func() { server.Close() }) newNode := func(bodyA interface{}, bodyB interface{}) SuiteNode { return NewSynchronizedBeforeSuiteNode(bodyA, bodyB, codeLocation, time.Millisecond, failer) } Describe("when not running in parallel", func() { Context("when all is well", func() {
dockerImageURL = "" dockerRegistryAddresses = "" insecureDockerRegistries = "" dockerDaemonExecutablePath = "/usr/bin/docker" cacheDockerImage = true dockerLoginServer = "" dockerUser = "" dockerPassword = "" dockerEmail = "" outputMetadataDir, err = ioutil.TempDir("", "building-result") Expect(err).NotTo(HaveOccurred()) outputMetadataJSONFilename = path.Join(outputMetadataDir, "result.json") fakeDockerRegistry = ghttp.NewServer() }) dockerPidExists := func() bool { _, err := os.Stat("/var/run/docker.pid") return err == nil } AfterEach(func() { Eventually(dockerPidExists).Should(BeFalse()) os.RemoveAll(outputMetadataDir) }) JustBeforeEach(func() { args := []string{"-dockerDaemonExecutablePath", dockerDaemonExecutablePath, "-outputMetadataJSONFilename", outputMetadataJSONFilename}