Cluster E shared scaffold: DRY the path/name disambiguation specs - #1287
Merged
Merged
Conversation
PR 2 of the system-test redesign (Stage 2 plan, Finding 3). Pure
structural refactor -- same coverage, same 44 examples, same example
descriptions across all 15 files (verified by diffing --dry-run output
before/after).
Adds three helpers to spec_system_helper.rb:
- in_project(&block): collapses the @c.with_context { Dir.chdir(@proj_name)
{ ... } } triple-nesting repeated at 80+ call sites across this cluster.
- copy_fixture(fixture_relative_path, dest_dir): collapses the
FileUtils.mkdir_p + FileUtils.cp test_asset_path(...) pair repeated
identically in the 11 test_asset_path-based files.
- RSpec.shared_context "a fresh ceedling gem project", proj_prefix:
collapses the verbatim before(:all)/after(:all)/@proj_name/`ceedling new`
scaffold sequence, identical across all 15 files, into one include_context
line.
Also extracts copy_duplicate_dup_pairs -- a byte-for-byte identical private
method that existed independently in both
implicit_source_header_correspondence_disambiguation_spec.rb and
test_source_file_directive_spec.rb -- into one shared helper both files
call, matching the same pattern.
sibling_header_collision_spec.rb and bracket_path_handling_spec.rb keep
their inline C-fixture content untouched (per the investigation: collapsing
either to shared fixtures would scatter documentation the inline content
carries, or trade a runtime-generated bracket-named directory for a more
fragile checked-in one) -- only their outer scaffolding skeleton changes,
verified by diffing old/new content to confirm only re-indentation and the
intended skeleton lines moved.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 tasks
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.
Summary
PR 2 of 5 in the system-test redesign (Stage 2 plan, following the "System Test Duplication Assessment" report's Finding 3). Pure structural refactor across the 15-file path/name disambiguation cluster — same coverage, same 44 examples, same example descriptions before and after (verified by diffing
--dry-runoutput).Changes
Adds three helpers to
spec/support/system/spec_system_helper.rb:in_project(&block)— collapses the@c.with_context { Dir.chdir(@proj_name) { ... } }triple-nesting repeated at 80+ call sites across this cluster into one call.copy_fixture(fixture_relative_path, dest_dir)— collapses theFileUtils.mkdir_p+FileUtils.cp test_asset_path(...)pair repeated identically in the 11test_asset_path-based files.RSpec.shared_context "a fresh ceedling gem project", proj_prefix— collapses the verbatimbefore(:all)/after(:all)/@proj_name/ceedling newscaffold sequence, identical across all 15 files, into oneinclude_contextline.Also extracts
copy_duplicate_dup_pairs— a byte-for-byte identical private method that existed independently in bothimplicit_source_header_correspondence_disambiguation_spec.rbandtest_source_file_directive_spec.rb— into one shared helper both files call.sibling_header_collision_spec.rbandbracket_path_handling_spec.rbkeep their inline C-fixture content untouched, per the plan's investigation (collapsing to shared fixtures would scatter documentation the inline content carries, or trade a runtime-generated bracket-named directory for a more fragile checked-in one) — only their outer scaffolding skeleton changes.16 files changed, 774 insertions(+), 1180 deletions(-) — net -406 lines.
Verification
--dry-run: identical 44 examples, identical descriptions before/after.madsciencelab-pluginsDocker image (Linux).sibling_header_collision_spec.rb's transform was scripted (regex-based skeleton unwrap) and diffed line-by-line against the pre-transform file to confirm only re-indentation and the intended skeleton lines changed — no C-fixture content drift (squiggly heredocs are indentation-independent regardless).This is PR 2 of 5; the plan calls for a go-ahead before starting PR 3 (Cluster A battery trim).
🤖 Generated with Claude Code