Exemple
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
Cas
- Objectif
- 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
- Paquets
- mustermann 4.0.0
- Environnement
- ruby
- Créé
- 2026-08-16T16:29:44Z
Contrat
- 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
Fichiers
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9