本文整理汇总了Golang中github.com/cloudfoundry/cli/plugin/fakes.FakeCliConnection.CliCommandWithoutTerminalOutputStub方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeCliConnection.CliCommandWithoutTerminalOutputStub方法的具体用法?Golang FakeCliConnection.CliCommandWithoutTerminalOutputStub怎么用?Golang FakeCliConnection.CliCommandWithoutTerminalOutputStub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/plugin/fakes.FakeCliConnection
的用法示例。
在下文中一共展示了FakeCliConnection.CliCommandWithoutTerminalOutputStub方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
af app.AppFactory
)
BeforeEach(func() {
fakeCliConnection = &fakes.FakeCliConnection{}
})
JustBeforeEach(func() {
af = app.NewAppFactory(fakeCliConnection, curler)
})
Describe("Get", func() {
Context("when CC returns a valid app guid", func() {
BeforeEach(func() {
fakeCliConnection.CliCommandWithoutTerminalOutputStub = func(args ...string) ([]string, error) {
Expect(args).To(ConsistOf("app", "app1", "--guid"))
return []string{"app1-guid\n"}, nil
}
})
Context("when an App is returned", func() {
BeforeEach(func() {
curler = func(cli plugin.CliConnection, result interface{}, args ...string) error {
a, ok := result.(*app.CFApp)
Expect(ok).To(BeTrue())
a.Metadata.Guid = "app1-guid"
a.Entity.EnableSSH = true
a.Entity.Diego = true
a.Entity.State = "STARTED"
return nil
}
})