diff --git a/internal/interpreters/r_test.go b/internal/interpreters/r_test.go index 0abb27567..487dd4b74 100644 --- a/internal/interpreters/r_test.go +++ b/internal/interpreters/r_test.go @@ -360,7 +360,7 @@ func (s *RSuite) TestResolveRExecutableWhenPassedInPathExistsButNotValid() { err := interpreter.resolveRExecutable() s.Error(err) - s.Equal("couldn't parse R version from command output (/Users/billsager/dev/publishing-client-another/internal/interpreters/some/R --version)", err.Error()) + s.Equal(true, strings.Contains(err.Error(), "couldn't parse R version from command output")) s.Equal(false, interpreter.IsRExecutableValid()) } diff --git a/internal/publish/publish_test.go b/internal/publish/publish_test.go index 83ffdb748..e3c1bfd69 100644 --- a/internal/publish/publish_test.go +++ b/internal/publish/publish_test.go @@ -16,6 +16,7 @@ import ( "github.com/posit-dev/publisher/internal/deployment" "github.com/posit-dev/publisher/internal/events" "github.com/posit-dev/publisher/internal/inspect/dependencies/renv" + "github.com/posit-dev/publisher/internal/interpreters" "github.com/posit-dev/publisher/internal/logging" "github.com/posit-dev/publisher/internal/logging/loggingtest" "github.com/posit-dev/publisher/internal/project" @@ -111,6 +112,14 @@ func (s *PublishSuite) SetupTest() { cwd.Join("requirements.txt").WriteFile([]byte("flask\n"), 0600) cwd.Join("renv.lock").WriteFile([]byte(renvLockContent), 0600) + interpreters.NewRInterpreter = func(baseDir util.AbsolutePath, rExec util.Path, log logging.Logger) interpreters.RInterpreter { + i := interpreters.NewMockRInterpreter() + i.On("Init").Return(nil) + i.On("RequiresR", mock.Anything).Return(false, nil) + i.On("GetLockFilePath").Return(util.RelativePath{}, false, nil) + return i + } + } func (s *PublishSuite) TestNewFromState() {