_, err := os.Stat(test_1) Expect(err).ToNot(HaveOccurred()) _, err = os.Stat(filepath.Join(pluginDir, "test_1.exe")) Expect(err).ToNot(HaveOccurred()) }) if runtime.GOOS != "windows" { It("Chmods the plugin so it is executable", func() { 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() { pluginName, pluginMetadata := config.SetPluginArgsForCall(0) Expect(pluginName).To(Equal("Test1")) Expect(pluginMetadata.Location).To(Equal(filepath.Join(pluginDir, "test_1.exe"))) 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", "successfully installed"}, )) }) }) })