Context("Default Config", func() { It("sets the api key and defaults for the HttpClient and api host", func() { Expect(conf.ApiKey).To(Equal(apiKey)) Expect(conf.ApiHost).To(Equal("http://api.wunderground.com")) }) }) Context("Initialization", func() { It("panics if no api key is set in the config", func() { conf.ApiKey = "" Expect(func() { wunderground.New(conf) }).To(Panic()) }) It("panics if no api host is set in the config", func() { conf.ApiHost = "" Expect(func() { wunderground.New(conf) }).To(Panic()) }) }) Context("Conditions", func() { var ( fakeServer *MockWunderground w *wunderground.Wunderground ) BeforeEach(func() { fakeServer = NewMockWunderground() conf.ApiHost = fakeServer.Server.URL