github.com/sleungcy-sap/cli@v7.1.0+incompatible/integration/v7/push/tasks_test.go (about)

     1  package push
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/integration/helpers"
     5  
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  	. "github.com/onsi/gomega/gbytes"
     9  	"github.com/onsi/gomega/gexec"
    10  	. "github.com/onsi/gomega/gexec"
    11  )
    12  
    13  var _ = Describe("push with --task", func() {
    14  	var (
    15  		appName string
    16  	)
    17  
    18  	BeforeEach(func() {
    19  		appName = helpers.NewAppName()
    20  		helpers.WithHelloWorldApp(func(dir string) {
    21  			session := helpers.CF("push", appName, "-p", dir, "--task")
    22  			Eventually(session).Should(Exit(0))
    23  		})
    24  	})
    25  
    26  	When("pushing an app with the --task flag", func() {
    27  		var session *gexec.Session
    28  
    29  		BeforeEach(func() {
    30  			session = helpers.CF("app", appName)
    31  			Eventually(session).Should(Exit(0))
    32  		})
    33  
    34  		It("pushes the app without starting it", func() {
    35  			Expect(session).To(Say(`name:\s+%s`, appName))
    36  			Expect(session).To(Say(`requested state:\s+stopped`))
    37  		})
    38  		It("pushes the app with no routes", func() {
    39  			Expect(session).To(Say(`name:\s+%s`, appName))
    40  			Expect(session).To(Say(`routes:\s+last uploaded`))
    41  		})
    42  		It("pushes the app with no instances", func() {
    43  			Expect(session).To(Say(`name:\s+%s`, appName))
    44  			Expect(session).To(Say(`type:\s+web\s+sidecars:\s+instances:\s+0/1`))
    45  		})
    46  	})
    47  })