本文整理匯總了Golang中github.com/nttlabs/cli/cf/api/security_groups/fakes.FakeSecurityGroupRepo.CreateArgsForCall方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeSecurityGroupRepo.CreateArgsForCall方法的具體用法?Golang FakeSecurityGroupRepo.CreateArgsForCall怎麽用?Golang FakeSecurityGroupRepo.CreateArgsForCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/nttlabs/cli/cf/api/security_groups/fakes.FakeSecurityGroupRepo
的用法示例。
在下文中一共展示了FakeSecurityGroupRepo.CreateArgsForCall方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
Context("when the file specified has valid json", func() {
BeforeEach(func() {
tempFile.Write([]byte(`[{"protocol":"udp","ports":"8080-9090","destination":"198.41.191.47/1"}]`))
})
It("displays a message describing what its going to do", func() {
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Creating security group", "my-group", "my-user"},
[]string{"OK"},
))
})
It("creates the security group with those rules", func() {
_, rules := securityGroupRepo.CreateArgsForCall(0)
Expect(rules).To(Equal([]map[string]interface{}{
{"protocol": "udp", "ports": "8080-9090", "destination": "198.41.191.47/1"},
}))
})
Context("when the API returns an error", func() {
Context("some sort of awful terrible error that we were not prescient enough to anticipate", func() {
BeforeEach(func() {
securityGroupRepo.CreateReturns(errors.New("Wops I failed"))
})
It("fails loudly", func() {
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Creating security group", "my-group"},
[]string{"FAILED"},