示例
Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty.
sha256:1d3dcbda4a83bad6d8a121efdde846f76e441a95f04b0cecea623b47b94ab2b9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty. HOW
- 包
- sinatra 4.2.1
- 环境
- ruby
- 创建时间
- 2026-08-17T02:47:36Z
常见的想当然
A mounted Sinatra app should handle `GET /foo` via its `get "/"` route even when `PATH_INFO` is empty, instead of returning a 404.
这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。
契约
- A request to `/foo` on a Sinatra app mounted at `/foo` with a `get "/"` route returns a 200 status, not 404, when the request has no trailing slash.
- assert_equal 200, root_without_trailing_slash.status
- assert_equal 'root', root_without_trailing_slash.body.read
- assert_equal 200, root_with_trailing_slash.status
文件
- 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-17 · ed25519:d91480838ac982c9