示例
Handle Mustermann 4.0 Pattern#match returning Mustermann::Match with 0-indexed capture access rather than MatchData full-match indexing, union pattern flattening, and typed capture casting
sha256:a2635789046e2ef0215229a258cb70d1c5f303872d38df2add582aa9b6231c3c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Handle Mustermann 4.0 Pattern#match returning Mustermann::Match with 0-indexed capture access rather than MatchData full-match indexing, union pattern flattening, and typed capture casting HOW
- 包
- mustermann 4.0.0
- 环境
- ruby
- 创建时间
- 2026-08-16T16:29:44Z
契约
- assert Mustermann::Pattern#match returns Mustermann::Match instead of Ruby core MatchData
- assert match[0] accesses the first capture parameter rather than the full matched path string
- assert match[1] is nil for a single-capture pattern while match.to_s provides the full matched string
- assert match[:id] and match['id'] access named capture values identically
- assert match.params and match.to_h expose the extracted params hash directly on the match object
- assert match does not implement to_a unlike standard Ruby MatchData
- assert non-overlapping pattern union (|) compiles to a single Mustermann::Sinatra instance rather than Mustermann::Composite
- assert capture: { id: Integer } validates numeric segments and typecasts params to Integer instances
文件
- 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