Пример
Register autoload callbacks with full constant-path syntax, including a leading `::` namespace, in Zeitwerk callbacks.
sha256:fffe98f22d4caebdca755c28577bb1de3b6c25546387a78a9b16996b6656bf2b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Register autoload callbacks with full constant-path syntax, including a leading `::` namespace, in Zeitwerk callbacks. HOW
- Пакеты
- zeitwerk 2.8.2
- Окружение
- ruby
- Создан
- 2026-08-17T02:49:24Z
Что обычно предполагают
Loader callback APIs are expected to accept only bare constant names, so `::User` should be rejected as an invalid path.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- 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`
Файлы
- Gemfile
- Gemfile.lock
- NOTES.md
- app/user.rb
- csx.json
- test/contract.rb
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9