Update digispark tests

This commit is contained in:
Adrian Zankich 2014-06-12 16:15:06 -07:00
parent b318eef6c4
commit 1a153df2b0
3 changed files with 19 additions and 37 deletions

View File

@ -14,7 +14,6 @@ func init() {
func TestFinalize(t *testing.T) {
gobot.Expect(t, b.Finalize(), true)
}
func TestConnect(t *testing.T) {
gobot.Expect(t, b.Connect(), true)
}

View File

@ -1,30 +1,26 @@
package digispark
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/hybridgroup/gobot"
"testing"
)
var _ = Describe("Digispark", func() {
var (
d *DigisparkAdaptor
)
var d *DigisparkAdaptor
BeforeEach(func() {
d = NewDigisparkAdaptor("bot")
d.connect = func(d *DigisparkAdaptor) {}
})
func init() {
d = NewDigisparkAdaptor("bot")
d.connect = func(d *DigisparkAdaptor) {}
}
It("Must be able to Finalize", func() {
Expect(d.Finalize()).To(Equal(true))
})
It("Must be able to Connect", func() {
Expect(d.Connect()).To(Equal(true))
})
It("Must be able to Disconnect", func() {
Expect(d.Disconnect()).To(Equal(true))
})
It("Must be able to Reconnect", func() {
Expect(d.Reconnect()).To(Equal(true))
})
})
func TestFinalize(t *testing.T) {
gobot.Expect(t, d.Finalize(), true)
}
func TestConnect(t *testing.T) {
gobot.Expect(t, d.Connect(), true)
}
func TestDisconnect(t *testing.T) {
gobot.Expect(t, d.Disconnect(), true)
}
func TestReconnect(t *testing.T) {
gobot.Expect(t, d.Reconnect(), true)
}

View File

@ -1,13 +0,0 @@
package digispark
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestGobotDigispark(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Gobot-Digispark Suite")
}