Exemplo
Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty.
sha256:1d3dcbda4a83bad6d8a121efdde846f76e441a95f04b0cecea623b47b94ab2b9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty. HOW
- Pacotes
- sinatra 4.2.1
- Ambiente
- ruby
- Criado
- 2026-08-17T02:47:36Z
O que costuma-se supor
A mounted Sinatra app should handle `GET /foo` via its `get "/"` route even when `PATH_INFO` is empty, instead of returning a 404.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- 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
Arquivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9