mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-11 19:29:20 +08:00
31 lines
552 B
Go
31 lines
552 B
Go
package gpio
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Analog-Sensor", func() {
|
|
var (
|
|
t TestAdaptor
|
|
a *AnalogSensorDriver
|
|
)
|
|
|
|
BeforeEach(func() {
|
|
a = NewAnalogSensorDriver(t, "bot", "1")
|
|
})
|
|
|
|
It("Must be able to Read", func() {
|
|
Expect(a.Read()).To(Equal(99))
|
|
})
|
|
It("Must be able to Start", func() {
|
|
Expect(a.Start()).To(Equal(true))
|
|
})
|
|
It("Must be able to Halt", func() {
|
|
Expect(a.Halt()).To(Equal(true))
|
|
})
|
|
It("Must be able to Init", func() {
|
|
Expect(a.Init()).To(Equal(true))
|
|
})
|
|
})
|