outcome = node.Run(parallelNode, parallelTotal, server.URL()) }) Context("when A succeeds", func() { BeforeEach(func() { expectedState = types.RemoteBeforeSuiteData{[]byte("my data"), types.RemoteBeforeSuiteStatePassed} node = newNode(func() []byte { return []byte("my data") }, func([]byte) { ranB = true }) }) It("should post about A succeeding", func() { Ω(server.ReceivedRequests()).Should(HaveLen(1)) }) It("should run B", func() { Ω(ranB).Should(BeTrue()) }) It("should report success", func() { Ω(outcome).Should(BeTrue()) }) }) Context("when A fails", func() { BeforeEach(func() { expectedState = types.RemoteBeforeSuiteData{nil, types.RemoteBeforeSuiteStateFailed}
}) }) Context("as any other node", func() { BeforeEach(func() { node = newNode(func() { ranThing("A") }, func() { ranThing("B") }) outcome = node.Run(2, 3, server.URL()) }) It("should run A, and not run B", func() { Ω(thingsThatRan()).Should(Equal([]string{"A"})) }) It("should not talk to the server", func() { Ω(server.ReceivedRequests()).Should(BeEmpty()) }) It("should report success", func() { Ω(outcome).Should(BeTrue()) Ω(node.Passed()).Should(BeTrue()) Ω(node.Summary().State).Should(Equal(types.SpecStatePassed)) }) }) }) })