)

	Context("Check", func() {
		BeforeEach(func() {
			prefix = fmt.Sprintf("some-prefix-%v", rand.Int())
			kv = newFakeKV()
			kv.AddressCall.Returns.Address = "http://some-address/consul"

			spammer = helpers.NewSpammer(kv, time.Duration(0), prefix)
			spammer.Spam()

			Eventually(func() int {
				return kv.SetCall.CallCount.Value()
			}).Should(BeNumerically(">", 1))

			spammer.Stop()
		})

		It("gets all the sets", func() {
			Expect(spammer.Check()).To(Succeed())
			Expect(kv.GetCall.CallCount).Should(Equal(kv.SetCall.CallCount.Value()))
		})

		It("returns an error when a key doesn't exist", func() {
			kv.GetCall.Returns.Error = fmt.Errorf("could not find key: %s-some-key-0", prefix)

			err := spammer.Check()
			Expect(err).To(MatchError(ContainSubstring(fmt.Sprintf("could not find key: %v-some-key-0", prefix))))
		})

		It("returns an error when a key doesn't match it's value", func() {