@@ -3,7 +3,7 @@ package plugin_test
33import (
44 "io/ioutil"
55 "os"
6- "path"
6+ "path/filepath "
77 "runtime"
88
99 testconfig "github.com/cloudfoundry/cli/cf/configuration/fakes"
@@ -45,7 +45,7 @@ var _ = Describe("Install", func() {
4545 var err error
4646 homeDir , err = ioutil .TempDir (os .TempDir (), "plugin" )
4747 Expect (err ).ToNot (HaveOccurred ())
48- pluginDir = path .Join (homeDir , ".cf" , "plugin" )
48+ pluginDir = filepath .Join (homeDir , ".cf" , "plugin" )
4949
5050 curDir , err = os .Getwd ()
5151 Expect (err ).ToNot (HaveOccurred ())
@@ -79,15 +79,15 @@ var _ = Describe("Install", func() {
7979 })
8080
8181 AfterEach (func () {
82- os .Remove (path .Join (curDir , pluginFile .Name ()))
82+ os .Remove (filepath .Join (curDir , pluginFile .Name ()))
8383 os .Remove (homeDir )
8484 })
8585
8686 It ("if a file with the plugin name already exists under ~/.cf/plugin/" , func () {
87- err := fileutils .CopyFile (path .Join (pluginDir , pluginFile .Name ()), path .Join (curDir , pluginFile .Name ()))
87+ err := fileutils .CopyFile (filepath .Join (pluginDir , pluginFile .Name ()), filepath .Join (curDir , pluginFile .Name ()))
8888 Expect (err ).NotTo (HaveOccurred ())
8989
90- runCommand (path .Join (curDir , pluginFile .Name ()))
90+ runCommand (filepath .Join (curDir , pluginFile .Name ()))
9191 Expect (ui .Outputs ).To (ContainSubstrings (
9292 []string {"Installing plugin" },
9393 []string {"The file" , pluginFile .Name (), "already exists" },
@@ -101,24 +101,24 @@ var _ = Describe("Install", func() {
101101 BeforeEach (func () {
102102 setupTempExecutable ()
103103 config .UserHomePathReturns (homeDir )
104- runCommand (path .Join (curDir , pluginFile .Name ()))
104+ runCommand (filepath .Join (curDir , pluginFile .Name ()))
105105 })
106106
107107 AfterEach (func () {
108- os .Remove (path .Join (curDir , pluginFile .Name ()))
108+ os .Remove (filepath .Join (curDir , pluginFile .Name ()))
109109 os .Remove (homeDir )
110110 })
111111
112112 It ("copies the plugin into directory ~/.cf/plugin/PLUGIN_NAME" , func () {
113- _ , err := os .Stat (path .Join (curDir , pluginFile .Name ()))
113+ _ , err := os .Stat (filepath .Join (curDir , pluginFile .Name ()))
114114 Expect (err ).ToNot (HaveOccurred ())
115- _ , err = os .Stat (path .Join (pluginDir , pluginFile .Name ()))
115+ _ , err = os .Stat (filepath .Join (pluginDir , pluginFile .Name ()))
116116 Expect (err ).ToNot (HaveOccurred ())
117117 })
118118
119119 if runtime .GOOS != "windows" {
120120 It ("Chmods the plugin so it is executable" , func () {
121- fileInfo , err := os .Stat (path .Join (pluginDir , pluginFile .Name ()))
121+ fileInfo , err := os .Stat (filepath .Join (pluginDir , pluginFile .Name ()))
122122 Expect (err ).ToNot (HaveOccurred ())
123123 Expect (int (fileInfo .Mode ())).To (Equal (0700 ))
124124 })
@@ -127,7 +127,7 @@ var _ = Describe("Install", func() {
127127 It ("populate the configuration map with the plugin name and location" , func () {
128128 pluginName , pluginPath := config .SetPluginArgsForCall (0 )
129129 Expect (pluginName ).To (Equal (pluginFile .Name ()))
130- Expect (pluginPath ).To (Equal (path .Join (pluginDir , pluginFile .Name ())))
130+ Expect (pluginPath ).To (Equal (filepath .Join (pluginDir , pluginFile .Name ())))
131131 Expect (ui .Outputs ).To (ContainSubstrings (
132132 []string {"Installing plugin" , pluginFile .Name ()},
133133 []string {"OK" },
0 commit comments