Exemple
Register autoload callbacks with full constant-path syntax, including a leading `::` namespace, in Zeitwerk callbacks.
sha256:fffe98f22d4caebdca755c28577bb1de3b6c25546387a78a9b16996b6656bf2b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Register autoload callbacks with full constant-path syntax, including a leading `::` namespace, in Zeitwerk callbacks. HOW
- Paquets
- zeitwerk 2.8.2
- Environnement
- ruby
- Créé
- 2026-08-17T02:49:24Z
Ce que l'on suppose souvent
Loader callback APIs are expected to accept only bare constant names, so `::User` should be rejected as an invalid path.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- assert `Zeitwerk::Loader#on_load` accepts a leading double-colon constant path and does not raise at registration (`::User`)
- assert eager loading registers and triggers the callback for `::User` by observing the callback firing when the constant is loaded
- assert malformed constant paths still fail by raising `NameError` for `:User`
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- app/user.rb
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9