Exemple
Show that `Set#intersect?` does not return a boolean for invalid scalar input.
sha256:5c69231633e7101fea59bbb26a50ac658769097fd11a2acec8e6cd2c54cee639
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Show that `Set#intersect?` does not return a boolean for invalid scalar input. HOW
- Paquets
- set 1.1.1
- Environnement
- ruby
- Créé
- 2026-08-17T02:46:59Z
Ce que l'on suppose souvent
Calling `Set#intersect?` with a scalar will simply return `false`.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9