chore(go): wrap core filesystem errors with context
This commit is contained in:
@@ -67,3 +67,12 @@ func (s *GenerateSuite) TestGenerate_DoesNotAddOriginWhenGitHubUserMissing() {
|
||||
require.NoError(s.T(), err)
|
||||
require.NotContains(s.T(), string(content), "[remote \"origin\"]")
|
||||
}
|
||||
|
||||
func (s *GenerateSuite) TestGenerate_WrapsCastlePathCreationError() {
|
||||
blocker := filepath.Join(s.tmpDir, "blocker")
|
||||
require.NoError(s.T(), os.WriteFile(blocker, []byte("x"), 0o644))
|
||||
|
||||
err := s.app.Generate(filepath.Join(blocker, "castle"))
|
||||
require.Error(s.T(), err)
|
||||
require.Contains(s.T(), err.Error(), "create castle path")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user