Beispiel
Demonstrate that Set#merge accepts multiple enumerable arguments and zero arguments rather than strictly requiring a single argument.
sha256:2d9066b6b344ce373a3c25794dab5a3006dc7b40a08549af8cb903a9892b0167
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Demonstrate that Set#merge accepts multiple enumerable arguments and zero arguments rather than strictly requiring a single argument. HOW
- Pakete
- set 1.1.1
- Umgebung
- ruby
- Erstellt
- 2026-08-17T02:46:35Z
Häufige Annahme
Set#merge accepts only a single enumerable argument at a time, requiring chained or sequential merge calls to combine multiple collections.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Set#merge accepts multiple enumerable arguments in a single invocation, mutating the receiver in place with elements from all passed collections and returning self.
- Set[1, 2].merge([3, 4], Set[4, 5], 6..7) returns the mutated receiver containing all 7 distinct elements.
- Set[1, 2].merge() with zero arguments leaves the receiver unchanged and returns self without raising ArgumentError.
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9