當前位置: 首頁>>代碼示例>>Golang>>正文


Golang FakePluginConfiguration.SetPluginArgsForCall方法代碼示例

本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/configuration/plugin_config/fakes.FakePluginConfiguration.SetPluginArgsForCall方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakePluginConfiguration.SetPluginArgsForCall方法的具體用法?Golang FakePluginConfiguration.SetPluginArgsForCall怎麽用?Golang FakePluginConfiguration.SetPluginArgsForCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/cloudfoundry/cli/cf/configuration/plugin_config/fakes.FakePluginConfiguration的用法示例。


在下文中一共展示了FakePluginConfiguration.SetPluginArgsForCall方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1:

		})

		if runtime.GOOS != "windows" {
			It("Chmods the plugin so it is executable", func() {
				runCommand(test_1, "-f")

				fileInfo, err := os.Stat(filepath.Join(pluginDir, "test_1.exe"))
				Expect(err).ToNot(HaveOccurred())
				Expect(int(fileInfo.Mode())).To(Equal(0700))
			})
		}

		It("populate the configuration with plugin metadata", func() {
			runCommand(test_1, "-f")

			pluginName, pluginMetadata := pluginConfig.SetPluginArgsForCall(0)

			Expect(pluginName).To(Equal("Test1"))
			Expect(pluginMetadata.Location).To(Equal(filepath.Join(pluginDir, "test_1.exe")))
			Expect(pluginMetadata.Version.Major).To(Equal(1))
			Expect(pluginMetadata.Version.Minor).To(Equal(2))
			Expect(pluginMetadata.Version.Build).To(Equal(4))
			Expect(pluginMetadata.Commands[0].Name).To(Equal("test_1_cmd1"))
			Expect(pluginMetadata.Commands[0].HelpText).To(Equal("help text for test_1_cmd1"))
			Expect(pluginMetadata.Commands[1].Name).To(Equal("test_1_cmd2"))
			Expect(pluginMetadata.Commands[1].HelpText).To(Equal("help text for test_1_cmd2"))
			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"Installing plugin", test_1},
				[]string{"OK"},
				[]string{"Plugin", "Test1", "v1.2.4", "successfully installed"},
			))
開發者ID:emc-xchallenge,項目名稱:cli,代碼行數:31,代碼來源:install_plugin_test.go


注:本文中的github.com/cloudfoundry/cli/cf/configuration/plugin_config/fakes.FakePluginConfiguration.SetPluginArgsForCall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。