chore(go): wrap core filesystem errors with context
This commit is contained in:
@@ -99,3 +99,15 @@ func (s *TrackSuite) TestTrack_DefaultCastleName() {
|
||||
require.NoError(s.T(), err)
|
||||
require.Equal(s.T(), expectedTarget, linkTarget)
|
||||
}
|
||||
|
||||
func (s *TrackSuite) TestTrack_WrapsSubdirRecordingError() {
|
||||
castleRoot := s.createCastleRepo("dotfiles")
|
||||
require.NoError(s.T(), os.MkdirAll(filepath.Join(castleRoot, ".homesick_subdir"), 0o755))
|
||||
|
||||
filePath := filepath.Join(s.homeDir, ".config", "myapp", "config.toml")
|
||||
s.writeFile(filePath, "ok=true\n")
|
||||
|
||||
err := s.app.Track(filePath, "dotfiles")
|
||||
require.Error(s.T(), err)
|
||||
require.Contains(s.T(), err.Error(), "record tracked subdir")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user