本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/stacks/fakes.FakeStackRepository.FindAllReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeStackRepository.FindAllReturns方法的具体用法?Golang FakeStackRepository.FindAllReturns怎么用?Golang FakeStackRepository.FindAllReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/cf/api/stacks/fakes.FakeStackRepository
的用法示例。
在下文中一共展示了FakeStackRepository.FindAllReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
requirementsFactory.LoginSuccess = true
Expect(testcmd.RunCliCommand("stacks", []string{"etcetc"}, requirementsFactory, updateCommandDependency, false)).To(BeFalse())
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"FAILED"},
[]string{"Incorrect Usage."},
))
})
})
It("lists the stacks", func() {
stack1 := models.Stack{
Name: "Stack-1",
Description: "Stack 1 Description",
}
stack2 := models.Stack{
Name: "Stack-2",
Description: "Stack 2 Description",
}
repo.FindAllReturns([]models.Stack{stack1, stack2}, nil)
testcmd.RunCliCommand("stacks", []string{}, requirementsFactory, updateCommandDependency, false)
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Getting stacks in org", "my-org", "my-space", "my-user"},
[]string{"OK"},
[]string{"Stack-1", "Stack 1 Description"},
[]string{"Stack-2", "Stack 2 Description"},
))
})
})