Skip to content

Commit

Permalink
Update sphero tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Jun 13, 2014
1 parent f5e38ae commit 1a63727
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 59 deletions.
13 changes: 0 additions & 13 deletions platforms/sphero/gobot-sphero_suite_test.go

This file was deleted.

38 changes: 14 additions & 24 deletions platforms/sphero/sphero_adaptor_test.go
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
package sphero

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/hybridgroup/gobot"
"testing"
)

var _ = Describe("SpheroAdaptor", func() {
var (
a *SpheroAdaptor
)
var a *SpheroAdaptor

BeforeEach(func() {
a = NewSpheroAdaptor("bot", "/dev/null")
a.sp = sp{}
a.connect = func(a *SpheroAdaptor) {}
})
func init() {
a = NewSpheroAdaptor("bot", "/dev/null")
a.sp = sp{}
a.connect = func(a *SpheroAdaptor) {}
}

It("Must be able to Finalize", func() {
Expect(a.Finalize()).To(Equal(true))
})
It("Must be able to Connect", func() {
Expect(a.Connect()).To(Equal(true))
})
It("Must be able to Disconnect", func() {
Expect(a.Disconnect()).To(Equal(true))
})
It("Must be able to Reconnect", func() {
Expect(a.Reconnect()).To(Equal(true))
})
})
func TestFinalize(t *testing.T) {
gobot.Expect(t, a.Finalize(), true)
}
func TestConnect(t *testing.T) {
gobot.Expect(t, a.Connect(), true)
}
37 changes: 15 additions & 22 deletions platforms/sphero/sphero_driver_test.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
package sphero

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/hybridgroup/gobot"
"testing"
)

var _ = Describe("SpheroDriver", func() {
var (
s *SpheroDriver
a *SpheroAdaptor
)
var s *SpheroDriver

BeforeEach(func() {
a = NewSpheroAdaptor("bot", "/dev/null")
a.sp = sp{}
s = NewSpheroDriver(a, "bot")
})
func init() {
a := NewSpheroAdaptor("bot", "/dev/null")
a.sp = sp{}
s = NewSpheroDriver(a, "bot")
}

It("Must be able to Start", func() {
Expect(s.Start()).To(Equal(true))
})
It("Must be able to Init", func() {
Expect(s.Init()).To(Equal(true))
})
It("Must be able to Halt", func() {
Expect(s.Halt()).To(Equal(true))
})
})
func TestStart(t *testing.T) {
gobot.Expect(t, s.Start(), true)
}

func TestHalt(t *testing.T) {
gobot.Expect(t, s.Halt(), true)
}

0 comments on commit 1a63727

Please sign in to comment.