Exemple
sinatra 4.2.1: Handle Sinatra error dispatch, status code handlers, show_exceptions modes, and route return value coercion without uncaught test exceptions, overwritten halt bodies, or symbol template lookups
Échantillon vérifié pour gem sinatra 4.2.1: Handle Sinatra error dispatch, status code handlers, show_exceptions modes, and route return value coercion…
sha256:6e3c39259c903ef98aa1a3a0b9b3c1dad0a3af159e7e3d689ce10e03f43cf009
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 2
- Clés de signature qui l’ont compilé
- 2
Environnement déclaré
ruby linux x64 ruby ruby bundler
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-17 |
| ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-18 |
Cas
HOW- Objectif
- Handle Sinatra error dispatch, status code handlers, show_exceptions modes, and route return value coercion without uncaught test exceptions, overwritten halt bodies, or symbol template lookups
- Symboles
-
- Sinatra::Base
- Sinatra::Base.error
- Sinatra::Base.not_found
- Sinatra::Base#halt
- Sinatra::Base#pass
- Sinatra::Base#status
- Sinatra::ShowExceptions
- Rack::Test::Methods
- Environnement
- ruby
- Créé
- 2026-08-17T01:20:49Z
Contrat
- assert in development mode default show_exceptions intercepts custom exceptions with an HTML backtrace rather than running the error handler
- assert setting show_exceptions to :after_handler executes custom error handlers while leaving unhandled exceptions to the debug page
- assert in test mode with raise_errors enabled, unhandled exceptions are re-raised out of the Rack call rather than returning 500
- assert defining an error 404 or not_found handler silently overwrites the custom body passed to halt 404
- assert returning a status code with a string body in a route is superseded by the registered status error handler
- assert returning a Symbol from a route block performs a template lookup and produces an empty body rather than setting the status code or string body
- assert returning an Integer from a route sets the HTTP status code and an empty body, including when status 201 is the final expression
- assert returning a Hash serves concatenated key-value array chunks as text/html rather than JSON
- assert pass throws to the next matching route within the same request instance, preserving instance variables while resetting route params
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.rb
- test/contract.rb