github.com/randomtask1155/cli@v6.41.1-0.20181227003417-a98eed78cbde+incompatible/integration/helpers/route_mapping.go (about)

     1  package helpers
     2  
     3  import (
     4  	"fmt"
     5  
     6  	. "github.com/onsi/gomega"
     7  	. "github.com/onsi/gomega/gbytes"
     8  	. "github.com/onsi/gomega/gexec"
     9  )
    10  
    11  func MapRouteToApplication(app string, domain string, host string, path string) {
    12  	Eventually(CF("map-route", app, domain, "--hostname", host, "--path", path)).Should(Exit(0))
    13  	Eventually(CF("routes")).Should(And(Exit(0), Say(fmt.Sprintf("%s\\s+%s\\s+/%s\\s+%s", host, domain, path, app))))
    14  }
    15  
    16  func UnmapRouteFromApplication(app string, domain string, host string, path string) {
    17  	Eventually(CF("unmap-route", app, domain, "--hostname", host, "--path", path)).Should(Exit(0))
    18  	session := CF("routes")
    19  	Eventually(session).Should(Exit(0))
    20  	Eventually(session).ShouldNot(Say(fmt.Sprintf("%s\\s+%s\\s+/%s\\s+%s", host, domain, path, app)))
    21  }