Skip to content

Scope test models to their owning cases - #115

Open
nertzy wants to merge 1 commit into
resolve-configured-table-name-rdyfrom
with-model-test-unit-migration
Open

Scope test models to their owning cases#115
nertzy wants to merge 1 commit into
resolve-configured-table-name-rdyfrom
with-model-test-unit-migration

Conversation

@nertzy

@nertzy nertzy commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

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_model and with_table to 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.

@nertzy nertzy changed the title with model test unit migration Scope test models to their owning cases Sep 5, 2026
@nertzy
nertzy force-pushed the with-model-test-unit-migration branch from 59af64d to 6eaee87 Compare September 5, 2026 01:30
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
nertzy force-pushed the with-model-test-unit-migration branch from 6eaee87 to a7c7603 Compare September 5, 2026 01:59
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.

1 participant