Skip to content

Resolve default spec paths from the project root - #364

Open
ac1982 wants to merge 1 commit into
shellspec:masterfrom
ac1982:fix/default-path-project-root
Open

ac1982 wants to merge 1 commit into
shellspec:masterfrom
ac1982:fix/default-path-project-root

Conversation

@ac1982

@ac1982 ac1982 commented Oct 20, 2026

Copy link
Copy Markdown

Running shellspec from a project subdirectory currently resolves the implicit spec path against that subdirectory, despite having found and changed to the project root. It exits with Not found a path: spec.

Resolve the implicit default path and its path patterns against the discovered project root. Keep explicitly supplied paths relative to the invocation directory. This avoids changing SHELLSPEC_CWD, which other operations also use. Document the distinction in the execution-directory guide.

Fixes #363.

Four integration tests exercise default and explicit paths/patterns through the actual CLI; two fail before the change. All four pass under sh, Bash and zsh. Eight additional public CLI checks cover root/subdirectory execution, translation, syntax checking, an absolute default path and -C.

The full sh suite runs 1,700 examples with one failure and 58 skips. The clean base runs 1,696 examples with the same failure/skips: the existing symlink finddirs() test encounters ls: not listing already-listed directory on this host. ShellCheck is clean for the new test; the command retains four identical baseline diagnostics. Other operating systems and the complete supported-shell matrix were not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running from a subdirectory results in "Not found a path: spec."

1 participant