サンプル
Expand patterns with extra parameters using :append or :ignore mode and handle splat array captures and 0-indexed match results
sha256:0e8601385466c7cb8202d018a4f507e1647f9fae76799eec75b6ba880b0ed328
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Expand patterns with extra parameters using :append or :ignore mode and handle splat array captures and 0-indexed match results HOW
- パッケージ
- mustermann 4.0.0
- 環境
- ruby
- 作成日
- 2026-08-16T15:52:59Z
コントラクト
- Mustermann.new('/users/:id').expand(id: 42, tab: 'profile') raises Mustermann::ExpandError in default mode when unknown keys are passed
- Mustermann.new('/users/:id').expand(:append, id: 42, tab: 'profile') serializes extra parameters as query string '/users/42?tab=profile'
- Mustermann.new('/users/:id').expand(:ignore, id: 42, tab: 'profile') drops extra parameters returning '/users/42'
- Mustermann.new('/files/*').params('/files/docs/report.pdf')['splat'] returns an Array ['docs/report.pdf'] rather than a String
- Mustermann.new('/users/:id').match('/users/42')[0] returns the first capture '42' instead of the full matched path
ファイル
- Gemfile
- Gemfile.lock
- 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