@@ -788,48 +788,19 @@ func (s *CreateLockfileFunctionalSuite) TearDownSuite() {
788
788
// TestCreateLockfileWithSpacesInPath tests that CreateLockfile can successfully
789
789
// create a lockfile in a path that contains spaces
790
790
func (s * CreateLockfileFunctionalSuite ) TestCreateLockfileWithSpacesInPath () {
791
- // Skip if R is not available with renv
792
- // if !s.isRenvAvailable() {
793
- // s.T().Skip("renv package is not available in R")
794
- // return
795
- // }
796
-
797
- // Create a lockfile path with spaces
791
+ // Create a lockfile on a path with spaces, this is problematic on Windows but
798
792
lockfilePath := util .NewAbsolutePath (filepath .Join (s .tempSpaceDir , "renv.lock" ), s .fs )
799
793
800
794
// Ensure the directory exists
801
795
err := os .MkdirAll (filepath .Dir (lockfilePath .String ()), 0755 )
802
796
s .Require ().NoError (err )
803
797
804
- // Try to create the lockfile
798
+ // Try to successfully create the lockfile
805
799
err = s .rInterpreter .CreateLockfile (lockfilePath )
806
-
807
- // This should succeed with our fix
808
800
s .NoError (err , "CreateLockfile should succeed with spaces in the path" )
809
801
810
- // Verify the lockfile was created
802
+ // And verify
811
803
exists , err := lockfilePath .Exists ()
812
804
s .NoError (err , "Should be able to check if lockfile exists" )
813
805
s .True (exists , "Lockfile should exist after CreateLockfile" )
814
806
}
815
-
816
- // isRenvAvailable checks if the renv package is available in R
817
- func (s * CreateLockfileFunctionalSuite ) isRenvAvailable () bool {
818
- // We'll assume renv might be available if:
819
- // 1. R is available (we already checked this)
820
- // 2. We have a valid R interpreter
821
-
822
- // First, let's just create a minimal test file without spaces
823
- tempLockfile := util .NewAbsolutePath (filepath .Join (s .tempDir , "test.lock" ), s .fs )
824
-
825
- // Try to create it - this will fail if renv isn't available
826
- err := s .rInterpreter .CreateLockfile (tempLockfile )
827
- if err != nil {
828
- fmt .Printf ("Error creating test lockfile: %v\n " , err )
829
- return false
830
- }
831
-
832
- // If we got here, renv is probably available
833
- exists , _ := tempLockfile .Exists ()
834
- return exists
835
- }
0 commit comments