Example #1
0
		Expect(len(status)).To(Equal(5))
		v := status["back yard"]["sprinklers"]
		Expect(v.Value).To(BeFalse())
	})

	It("gets the status of the gadget", func() {
		// status, err := g.Status()
		// Expect(err).To(BeNil())

		// Expect(len(status)).To(Equal(5))
		// v := status["back yard"]["sprinklers"]
		// Expect(v.Value).To(BeFalse())
	})

	It("updates the status of the gadget", func() {
		err := g.Update("turn on back yard sprinklers")
		Expect(err).To(BeNil())
		Expect(len(msgs)).To(Equal(1))
		m := msgs[0]
		Expect(m.Body).To(Equal("turn on back yard sprinklers"))
	})

	It("registers with a gogadgets instance", func() {
		h, err := g.Register(ts.URL, "fakecookie")
		Expect(err).To(BeNil())
		Expect(h).To(Equal(ts.URL))
		Expect(len(clients)).To(Equal(1))
		c := clients[0]
		Expect(c["address"]).To(Equal(ts.URL))
	})