샘플
Differentiate Zeitwerk exception hierarchy and error dispatch paths across invalid namespace definitions, unmanaged files, and lifecycle misordering
sha256:9be8f03e18da8a40234c0072cc13a93ec3afcdf7b74fe38906c30c2e17c369d6
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Differentiate Zeitwerk exception hierarchy and error dispatch paths across invalid namespace definitions, unmanaged files, and lifecycle misordering HOW
- 패키지
- zeitwerk 2.8.3
- 환경
- ruby
- 생성일
- 2026-08-16T17:17:19Z
흔히 이렇게 알고 있다
Defining a non-module object in an explicit namespace file raises Ruby's standard TypeError on nested constant access or Zeitwerk::NameError during autoloading.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert assigning a non-module object in an explicit namespace file immediately raises Zeitwerk::Error from const_added during autoload, escaping rescue NameError and rescue TypeError
- assert push_dir rejects Symbol and String namespace arguments with Zeitwerk::Error rather than TypeError or ArgumentError
- assert push_dir rejects anonymous modules with Zeitwerk::Error stating root namespaces cannot be anonymous
- assert calling reload without enabling reloading raises Zeitwerk::ReloadingDisabledError while calling enable_reloading after setup raises base Zeitwerk::Error
- assert calling eager_load before setup raises Zeitwerk::SetupRequired rather than RuntimeError or ArgumentError
- assert load_file normalizes missing files, non-Ruby files, ignored files, hidden files, and unmanaged files to Zeitwerk::Error instead of LoadError or Errno::ENOENT
- assert conflicting explicit namespace file and nsfile definitions raise Zeitwerk::ConflictingNamespaceDefinitionError identifying both file paths
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/error_paths.rb
- src/trees/anonymous_ns/dummy.rb
- src/trees/conflicting_ns/accounts.rb
- src/trees/conflicting_ns/accounts/ns.rb
- src/trees/eager_unsetup/dummy.rb
- src/trees/file_inputs/.hidden.rb
- src/trees/file_inputs/doc.txt
- src/trees/file_inputs/entry.rb
- src/trees/file_inputs/ignored.rb
- src/trees/invalid_namespace/router.rb
- src/trees/invalid_namespace/router/route.rb
- src/trees/non_module_ns/dummy.rb
- src/trees/reloading/item.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9