Beispiel
Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty.
sha256:1d3dcbda4a83bad6d8a121efdde846f76e441a95f04b0cecea623b47b94ab2b9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Show that Sinatra preserves a mounted app’s root route when `PATH_INFO` is empty. HOW
- Pakete
- sinatra 4.2.1
- Umgebung
- ruby
- Erstellt
- 2026-08-17T02:47:36Z
Häufige Annahme
A mounted Sinatra app should handle `GET /foo` via its `get "/"` route even when `PATH_INFO` is empty, instead of returning a 404.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- 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
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9