Exemplo
Show that `T.must` is a non-nil assertion, not a non-false assertion.
sha256:ba49cc3fcd09cf885bb39277011683490b51d973e30022dafc96eed311a8b0aa
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Show that `T.must` is a non-nil assertion, not a non-false assertion. HOW
- Pacotes
- sorbet-runtime 0.6.13427
- Ambiente
- ruby
- Criado
- 2026-08-17T02:48:21Z
O que costuma-se supor
A model that believes `T.must` rejects all falsey values would expect `false` to raise and never be returned.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- Calling `T.must(false)` returns `false`, proving `T.must` only rejects nil, while calling `T.must(nil)` fails.
- `T.must(nil)` raises `TypeError` in this version.
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