TestSpec_PublicAPI_FindGitRoot validates the documented behavior of FindGitRoot as described in the package README.md. Specification: Returns the absolute path of the root directory of the current Git repository using pure Go filesystem traversal (no `git` subprocess); starts from the current worki
(t *testing.T)
| 282 | // Git repository using pure Go filesystem traversal (no `git` subprocess); |
| 283 | // starts from the current working directory. |
| 284 | func TestSpec_PublicAPI_FindGitRoot(t *testing.T) { |
| 285 | t.Run("returns non-empty absolute path when in git repository", func(t *testing.T) { |
| 286 | root, err := gitutil.FindGitRoot() |
| 287 | require.NoError(t, err, "FindGitRoot should not error when inside a git repository") |
| 288 | assert.NotEmpty(t, root, "FindGitRoot should return a non-empty path") |
| 289 | assert.True(t, filepath.IsAbs(root), |
| 290 | "FindGitRoot should return an absolute path, got %q", root) |
| 291 | }) |
| 292 | } |
| 293 | |
| 294 | // TestSpec_PublicAPI_FindGitRootFrom validates the documented behavior of |
| 295 | // FindGitRootFrom as described in the package README.md. |
nothing calls this directly
no test coverage detected