Example #1
0
{{define "head"}}
some head text
{{end}}`
	homepageTemplate = `
{{define "homepage"}}
{{template "head"}}
some text here
{{end}}`
)

var (
	fakeLogger         lager.Logger
	fakeLightHandler   *light_fakes.FakeHandler
	fakeLoginHandler   *login_fakes.FakeHandler
	fakeResponseWriter *test_helpers_fakes.FakeResponseWriter

	dummyRequest *http.Request
	hh           homepage.Handler

	templates *template.Template
)

var _ = Describe("Homepage", func() {
	BeforeEach(func() {
		fakeLogger = lagertest.NewTestLogger("homepage handle test")
		fakeLightHandler = new(light_fakes.FakeHandler)
		fakeLoginHandler = new(login_fakes.FakeHandler)
		fakeResponseWriter = new(test_helpers_fakes.FakeResponseWriter)

		var err error
Example #2
0
	. "github.com/onsi/gomega"
	"github.com/pivotal-golang/lager"
	"github.com/pivotal-golang/lager/lagertest"
	"github.com/robdimsdale/garagepi/api/light"
	test_helpers_fakes "github.com/robdimsdale/garagepi/fakes"
	gpio_fakes "github.com/robdimsdale/garagepi/gpio/fakes"
)

const (
	gpioLightPin = uint(1)
)

var (
	fakeLogger         lager.Logger
	fakeGpio           *gpio_fakes.FakeGpio
	fakeResponseWriter *test_helpers_fakes.FakeResponseWriter

	dummyRequest *http.Request
	lh           light.Handler
)

var _ = Describe("Light", func() {
	var expectedLightState light.LightState
	var expectedReturn []byte
	var err error

	BeforeEach(func() {
		expectedLightState = light.LightState{
			StateKnown: false,
			LightOn:    false,
		}
Example #3
0
	"github.com/pivotal-golang/lager/lagertest"
	"github.com/robdimsdale/garagepi/api/door"
	test_helpers_fakes "github.com/robdimsdale/garagepi/fakes"
	gpio_fakes "github.com/robdimsdale/garagepi/gpio/fakes"
	os_fakes "github.com/robdimsdale/garagepi/os/fakes"
)

const (
	gpioDoorPin = uint(1)
)

var (
	fakeOSHelper       *os_fakes.FakeOSHelper
	fakeLogger         lager.Logger
	fakeGpio           *gpio_fakes.FakeGpio
	fakeResponseWriter *test_helpers_fakes.FakeResponseWriter

	dummyRequest *http.Request
	dh           door.Handler
)

var _ = Describe("Door", func() {
	BeforeEach(func() {
		fakeLogger = lagertest.NewTestLogger("Door test")
		fakeOSHelper = new(os_fakes.FakeOSHelper)
		fakeGpio = new(gpio_fakes.FakeGpio)
		fakeResponseWriter = new(test_helpers_fakes.FakeResponseWriter)

		dh = door.NewHandler(
			fakeLogger,
			fakeOSHelper,