샘플
Distinguish JSON.dump Marshal-compatible default options and argument dispatch from JSON.generate strict limits
sha256:4c386a5b763c3a3e2bbc668a77a917939638feb691e08cb081805758360988ae
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Distinguish JSON.dump Marshal-compatible default options and argument dispatch from JSON.generate strict limits HOW
- 패키지
- json 2.9.1
- 환경
- ruby
- 생성일
- 2026-08-17T02:43:30Z
흔히 이렇게 알고 있다
JSON.dump is a direct alias for JSON.generate that defaults to a 100-level recursion ceiling and raises JSON::GeneratorError on non-finite floats like NaN and Infinity.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- JSON.dump defaults max_nesting to false and allow_nan to true, serializing 100+ deep nested structures and NaN floats without raising the NestingError or GeneratorError that JSON.generate enforces
- assert JSON.dump routes a non-IO integer passed as its second argument to the nesting limit and returns a String, whereas passing an IO stream writes to the stream and returns the IO instance itself
- assert exceeding the nesting limit in JSON.dump raises ArgumentError with exceed depth limit rather than JSON::NestingError
- assert passing unsupported generator keyword arguments to JSON.dump raises ArgumentError due to strict keyword filtering
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/dump_adapter.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