サンプル
Demonstrate that turning on `return_headers` changes how header columns are surfaced when `headers: true` is also enabled.
sha256:3d12db62adbd2a7953f464fa2bbaaffa6d87ba0e99054b30dad1404f2b997473
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Demonstrate that turning on `return_headers` changes how header columns are surfaced when `headers: true` is also enabled. HOW
- パッケージ
- csv 3.3.2
- 環境
- ruby
- 作成日
- 2026-08-16T15:29:58Z
よくある思い込み
A parser configured with `headers: true` still makes column lookups expose only data rows, so the header names are never treated as a data value.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- assert CSV.parse("id,name\n1,alice\n2,bob\n", headers: true, return_headers: true)["name"] == ["name", "alice", "bob"]
- assert CSV.parse("id,name\n1,alice\n2,bob\n", headers: true)["name"] == ["alice", "bob"]
- assert CSV.parse("id,name\n1,alice\n", headers: true, return_headers: true).first.to_a == ["id", "name"]
ファイル
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9