Skip to content

Fix test fixture root shadowing let(:root). - #1

Merged
ioquatix merged 3 commits into
socketry:mainfrom
sampokuokkanen:test-fixture-root
Aug 20, 2026
Merged

Fix test fixture root shadowing let(:root).#1
ioquatix merged 3 commits into
socketry:mainfrom
sampokuokkanen:test-fixture-root

Conversation

@sampokuokkanen

@sampokuokkanen sampokuokkanen commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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.

sampokuokkanen and others added 2 commits August 20, 2026 23:51
`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
Assisted-By: devx/869c3330-b992-4d3c-b452-3e6c514a748b
@ioquatix
ioquatix merged commit a9af18d into socketry:main Aug 20, 2026
10 of 14 checks passed
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.

3 participants