샘플
Enforce JSON gem 2.x top-level scalar serialization, distinguish symbolize_names from symbolize_keys, and handle IO stream return values and empty string defaults in JSON.load
sha256:11b68ca217837cb2a5baf3ef7bd8bda4524866b9eccedef9840bab91c2e1098f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Enforce JSON gem 2.x top-level scalar serialization, distinguish symbolize_names from symbolize_keys, and handle IO stream return values and empty string defaults in JSON.load HOW
- 패키지
- json 2.9.1
- 환경
- ruby
- 생성일
- 2026-08-17T02:44:27Z
흔히 이렇게 알고 있다
JSON.generate and JSON.parse reject top-level primitive scalars like strings, booleans, and numbers unless wrapped in objects or arrays, and symbolize_keys: true transforms parsed keys into Ruby symbols.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert JSON.generate and JSON.parse serialize and deserialize top-level primitive strings, numbers, booleans, and nil directly without quirks mode, while symbolize_keys is silently ignored leaving string keys unless symbolize_names is used
- assert JSON.load with an empty string returns nil via default allow_blank but raises JSON::ParserError on non-empty whitespace, whereas JSON.parse raises JSON::ParserError on both
- assert JSON.dump with an IO destination writes the payload and returns the IO instance itself rather than the generated JSON string
- assert JSON.dump depth limit violation raises ArgumentError whereas JSON.generate depth limit violation raises JSON::NestingError
- assert JSON.dump with keyword arguments like indent raises ArgumentError for unknown keywords instead of configuring pretty printing
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_v2_core.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9