routes = route_helpers.Routes{ AppRoutes: route_helpers.AppRoutes{ appRoute1, appRoute2, }, TcpRoutes: route_helpers.TcpRoutes{ tcpRoute1, tcpRoute2, }, DiegoSSHRoute: diegoSSHRoute, } }) Describe("RoutingInfo", func() { var routingInfo receptor.RoutingInfo JustBeforeEach(func() { routingInfo = routes.RoutingInfo() }) It("wraps the serialized routes with the correct key", func() { expectedAppRoutes, err := json.Marshal(route_helpers.AppRoutes{appRoute1, appRoute2}) Expect(err).NotTo(HaveOccurred()) appRoutesPayload, err := routingInfo[route_helpers.AppRouter].MarshalJSON() Expect(err).NotTo(HaveOccurred()) Expect(appRoutesPayload).To(MatchJSON(expectedAppRoutes)) expectedTcpRoutes, err := json.Marshal(route_helpers.TcpRoutes{tcpRoute1, tcpRoute2}) Expect(err).NotTo(HaveOccurred()) tcpRoutesPayload, err := routingInfo[route_helpers.TcpRouter].MarshalJSON()