Scope test models to their owning cases - #115
Open
nertzy wants to merge 1 commit into
Open
Conversation
nertzy
force-pushed
the
with-model-test-unit-migration
branch
from
September 5, 2026 01:30
59af64d to
6eaee87
Compare
Use with_model and with_table to give each Test::Unit case the fixed tables and model constants it exercises. Remove the suite-wide database reconnect and migration helper while preserving explicit manual boundaries for autoloading, separate pools, and raw SQL behavior. #110
nertzy
force-pushed
the
with-model-test-unit-migration
branch
from
September 5, 2026 01:59
6eaee87 to
a7c7603
Compare
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.
The test suite currently recreates one shared SQLite schema for every example, leaves its Active Record model constants loaded for the entire process, and writes generated fixtures and its manifest through shared repository paths. That makes unrelated test cases depend on database and filesystem state they do not own.
Use
with_modelandwith_tableto give each Test::Unit case the fixed tables and model constants it exercises. Give each example a fresh temporary fixture directory and manifest, seed it with the repository-owned fixture inputs, and restore Rails’ fixture path afterward. Remove the suite-wide database reconnect, migration, and generated-file cleanup paths while preserving explicit manual boundaries for autoloading, separate connection pools, subprocesses, and raw SQL behavior.This is a test-only refactor above the model-resolution behavior in #113.