本文整理汇总了Golang中confab.Controller.SSLDisabled方法的典型用法代码示例。如果您正苦于以下问题:Golang Controller.SSLDisabled方法的具体用法?Golang Controller.SSLDisabled怎么用?Golang Controller.SSLDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类confab.Controller
的用法示例。
在下文中一共展示了Controller.SSLDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Context("when setting keys errors", func() {
It("returns the error", func() {
agentClient.SetKeysCall.Returns.Error = errors.New("oh noes")
Expect(controller.ConfigureServer()).To(MatchError("oh noes"))
Expect(agentClient.SetKeysCall.Receives.Keys).To(Equal([]string{
"key 1",
"key 2",
"key 3",
}))
})
})
Context("when the server does not have ssl enabled", func() {
BeforeEach(func() {
controller.SSLDisabled = true
})
It("does not set keys", func() {
Expect(controller.ConfigureServer()).To(Succeed())
Expect(agentClient.SetKeysCall.Receives.Keys).To(BeNil())
})
})
Context("when ssl is enabled but no keys are provided", func() {
BeforeEach(func() {
controller.EncryptKeys = []string{}
})
It("returns an error", func() {
Expect(controller.ConfigureServer()).To(MatchError("encrypt keys cannot be empty if ssl is enabled"))