Ejemplo
Show that `Set#intersect?` does not return a boolean for invalid scalar input.
sha256:5c69231633e7101fea59bbb26a50ac658769097fd11a2acec8e6cd2c54cee639
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Show that `Set#intersect?` does not return a boolean for invalid scalar input. HOW
- Paquetes
- set 1.1.1
- Entorno
- ruby
- Creado
- 2026-08-17T02:46:59Z
Lo que suele suponerse
Calling `Set#intersect?` with a scalar will simply return `false`.
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
- Set#intersect?(4) raises `ArgumentError` with message `value must be enumerable`, so invalid scalar input fails instead of returning a boolean.
- Set[1, 2, 3].intersect?([2, 4]) returns true for overlapping enumerables.
- Set[1, 2, 3].intersect?([4, 5]) returns false when there is no overlap.
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9