샘플
Distinguish Mustermann error hierarchy and exception types raised for malformed pattern syntax, invalid capture identifiers, anchored regexps, unsupported types, and missing expand parameters
sha256:aaa0dba8bc057cb87c4fc9aba644a736d975024736c643655c77f03ab87944e3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Distinguish Mustermann error hierarchy and exception types raised for malformed pattern syntax, invalid capture identifiers, anchored regexps, unsupported types, and missing expand parameters HOW
- 패키지
- mustermann 4.0.0
- 환경
- ruby
- 생성일
- 2026-08-16T15:54:28Z
흔히 이렇게 알고 있다
Malformed route pattern strings raise Mustermann::ParseError on invalid capture syntax, while :ignore expansion suppresses missing parameter errors.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- Mustermann raises Mustermann::CompileError rather than Mustermann::ParseError when a pattern contains malformed capture names such as empty captures or leading digits, while unclosed groupings raise Mustermann::ParseError and expand with :ignore still raises Mustermann::ExpandError when required keys are missing.
- assert Mustermann.new('/foo/:') and Mustermann.new('/foo/:123') raise Mustermann::CompileError instead of Mustermann::ParseError
- assert Mustermann.new('/foo/(bar') and Mustermann.new('/foo/{bar') raise Mustermann::ParseError with unexpected token messages
- assert Mustermann.new('^/foo', type: :regexp) raises Mustermann::CompileError when anchor characters are present in regular expressions
- assert Mustermann.new('/foo', type: :unsupported_custom_type) raises ArgumentError rather than Mustermann::Error
- assert pattern.expand(:ignore, {}) raises Mustermann::ExpandError when required captures are missing because :ignore only applies to extra keys
- assert pattern.expand(:invalid_behavior, id: 1) raises ArgumentError rather than Mustermann::ExpandError
- assert Mustermann::CompileError, Mustermann::ParseError, and Mustermann::ExpandError all inherit from Mustermann::Error < StandardError
파일
- 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