Conversation
Shell#gems called PinCache.cache_core, which does not exist, so
`solargraph gems core` died with a NoMethodError before caching
anything. cache_core is defined on RbsMap::CoreMap, so call it there.
PinCache only computes cache paths and serializes, and RbsMap::CoreMap
already depends on it, so delegating from PinCache would make that
dependency circular.
The @sg-ignore above the call claimed cache_core and core? were
dynamically defined. pin_cache.rb has no method_missing or
define_method, and core? exists nowhere, so the comment and the
commented-out `if !PinCache.core?` guard go with it.
The "caches core without erroring out" example sat under `describe
'gems'` but called shell.cache('core'), which takes the gem-lookup
path and never reached this line. It now calls shell.gems('core')
with RbsMap::CoreMap stubbed.
The previous commit rewrote `caches core without erroring out` rather than adding to it, dropping the coverage it gave `uncache core` and `cache core`. Put that example back as it was and keep the new assertion as its own example. Only the new one depends on the fix: reverting the lib change leaves the restored example passing and fails just `caches core pins from the gems command`.
The crash this branch fixed is gone: 1369 replaced the dynamically defined PinCache.cache_core with Collection::Core.load, so the lib change is superseded and shell.rb takes master's side whole. The spec is the part worth keeping. Master consolidated gems into cache, and gems survives only as a Thor alias rather than a Ruby method, so the example now drives shell.cache and asserts against Collection::Core.load. It guards that the CLI actually builds the core cache, which the neighbouring skipped example only asserts by not raising.
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.
This PR was written by Claude Code on behalf of @apiology.
Carried on the fork after castwide#1346 was closed as not planned, in favour of castwide#1369, now merged. The lib fix is genuinely superseded and has been dropped; what survives is the spec.
Problem: nothing asserts that
solargraph cache corebuilds the core cache. The neighbouring example only asserts it does not raise, which a no-op satisfies.Solution: one example driving
shell.cache('core')and assertingCollection::Core.loadis reached.The original crash —
PinCache.cache_corenamed a method that was only dynamically defined — is gone, because 1369 replaced that call withCollection::Core.load. Net diff against master isspec/shell_spec.rb, 8 lines added, no lib change.