サンプル
Manage Rack::Test type serialization boundaries across JSON Hash payloads, query parameter type coercion, multipart symbol keys, and CookieJar security scopes
sha256:5fe3699ec9450e25104ae03ae89602c44a28ffdbdf87748819f7f3de86bdc4bc
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Manage Rack::Test type serialization boundaries across JSON Hash payloads, query parameter type coercion, multipart symbol keys, and CookieJar security scopes HOW
- パッケージ
- rack-test 2.2.0 rack 3.2.7
- 環境
- ruby
- 作成日
- 2026-08-17T02:45:45Z
よくある思い込み
Passing a Hash payload to Rack::Test request methods with a JSON Content-Type header automatically serializes the body as JSON.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- assert posting a Hash with application/json Content-Type sends a form-urlencoded query string and fails JSON parsing unless explicitly passed as a serialized JSON string
- assert primitive Hash parameter types are coerced to strings, nil is preserved as nil, empty arrays mutate to an array containing an empty string, and empty hashes are omitted from params
- assert URI query string and params Hash merge overwrites scalar keys but appends array elements together
- assert UploadedFile triggers multipart encoding with symbol-keyed descriptor hashes while unwrapped IO objects are stringified into urlencoded form data
- assert CookieJar silently ignores Secure cookies received over plain HTTP, filters Secure cookies from HTTP requests, and scopes non-domain cookies to the exact host
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.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