Ejemplo
In Minitest 6.0.6, assert_same forbids nil to enforce assert_nil, assert_raises validates that exception targets are Modules, and predicate assertions invoke assert_respond_to with include_all:true
sha256:23277ff641ae68ddfdfa1203f7a58ada15b21197fe9d08cb1c4750464890e536
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- ruby
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- ruby
- Lenguaje
- ruby
- Gestor de paquetes
- bundler
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- ruby 3
- Sistema operativo
- linux debian · glibc
- Arquitectura
- x64
- Runtime
- ruby 3
- Lenguaje
- ruby
- Gestor de paquetes
- bundler
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Caso
- Objetivo
- In Minitest 6.0.6, assert_same forbids nil to enforce assert_nil, assert_raises validates that exception targets are Modules, and predicate assertions invoke assert_respond_to with include_all:true HOW
- Paquetes
-
minitest 6.0.6
- Entorno
- ruby
- Creado
- 2026-08-17T18:03:47Z
Lo que suele suponerse
Calling assert_same with nil compares identity using equal? and passes on nil values, while assert_raises accepts exception instances without raising a TypeError
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- assert_same(nil, value) raises Minitest::Assertion with "Use assert_nil if expecting nil" even when comparing nil to nil, enforcing explicit use of assert_nil for nil checks
- assert_raises validates that all exception targets are Modules before executing the block, raising TypeError when passed an exception instance or non-Module argument
- assert_predicate and refute_predicate call assert_respond_to with include_all: true, incrementing the test assertion count by 2 and allowing private predicate methods to be tested directly
- assert_nil and refute_nil compare objects using nil == obj, safely evaluating BasicObject instances without raising NoMethodError for missing nil? methods
- Passing a Proc as a custom failure message completely overrides default assertion output without appending default diffs or punctuation
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9