_, err := factory.ParseTcpRoutes("-1:6379") Expect(err).To(MatchError(command_factory.InvalidPortErrorMessage)) }) It("errors out when the external port is bigger than 65535", func() { _, err := factory.ParseTcpRoutes("65536:6379") Expect(err).To(MatchError(command_factory.InvalidPortErrorMessage)) }) }) }) Describe("ParseRouteOverrides", func() { Context("when valid http route is passed", func() { It("returns a valid RouteOverrides", func() { routeOverrides, err := factory.ParseRouteOverrides("foo.com:8080, bar.com:8181") Expect(err).NotTo(HaveOccurred()) Expect(routeOverrides).To(ContainExactly( app_runner.RouteOverrides{ {HostnamePrefix: "foo.com", Port: 8080}, {HostnamePrefix: "bar.com", Port: 8181}, }, )) }) }) Context("when a malformed http route is passed", func() { It("errors out when the container port is not an int", func() { _, err := factory.ParseRouteOverrides("foo:bar") Expect(err).To(MatchError(command_factory.InvalidPortErrorMessage)) })