Fix test fixture root shadowing let(:root). - #1
Merged
Conversation
`let(:root)` memoizes into `@root`, and the `around` block assigned `@root` directly, so the memo was already populated and the block never ran: `root` was the temporary directory itself rather than the intended `www` subdirectory. No existing test asserted the difference, but it makes it impossible to write a test about paths outside the root, as there is nothing outside it. Rename the fixture variable to `@temporary_root`.
Assisted-By: devx/869c3330-b992-4d3c-b452-3e6c514a748b
ioquatix
force-pushed
the
test-fixture-root
branch
from
August 20, 2026 11:51
2917c7e to
77e7708
Compare
Assisted-By: devx/869c3330-b992-4d3c-b452-3e6c514a748b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
let(:root)memoizes into@root, and thearoundblock assigned@rootdirectly, so the memo was already populated and the block neverran:
rootwas the temporary directory itself rather than the intendedwwwsubdirectory.No existing test asserted the difference, but it makes it impossible to
write a test about paths outside the root, as there is nothing outside
it. Rename the fixture variable to
@temporary_root.