本文整理汇总了Golang中github.com/cloudfoundry/cli/plugin/fakes.FakeCliConnection.UsernameReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeCliConnection.UsernameReturns方法的具体用法?Golang FakeCliConnection.UsernameReturns怎么用?Golang FakeCliConnection.UsernameReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/plugin/fakes.FakeCliConnection
的用法示例。
在下文中一共展示了FakeCliConnection.UsernameReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
BeforeEach(func() {
appsList = make([]plugin_models.GetAppsModel, 0)
appsList = append(appsList,
plugin_models.GetAppsModel{"spring-music", "", "", 0, 0, 0, 0, nil},
plugin_models.GetAppsModel{"qwerty", "", "", 0, 0, 0, 0, nil},
plugin_models.GetAppsModel{"apple_pie", "", "", 0, 0, 0, 0, nil},
)
myQuota := plugin_models.QuotaFields{}
myOrg := plugin_models.Organization{plugin_models.OrganizationFields{"", "Jeanie", myQuota}}
mySpace := plugin_models.Space{plugin_models.SpaceFields{"", "development"}}
fakeCliConnection = &fakes.FakeCliConnection{}
fakeCliConnection.GetAppsReturns(appsList, nil)
fakeCliConnection.GetCurrentOrgReturns(myOrg, nil)
fakeCliConnection.GetCurrentSpaceReturns(mySpace, nil)
fakeCliConnection.UsernameReturns("[email protected]", nil)
wildcardPlugin = &Wildcard{}
ui = &testterm.FakeUI{}
})
Describe("When the user provides correct input for wildcard-apps", func() {
It("prints correct introductory message", func() {
output := io_helpers.CaptureOutput(func() {
wildcardPlugin.Run(fakeCliConnection, []string{"wildcard-apps", "app*"})
})
Expect(output).To(ContainSubstrings(
[]string{"Getting apps matching app* in org Jeanie"},
[]string{"space development"},
[]string{"as [email protected]"},
[]string{"OK"},
))