Commit 3de4cfc
Fix shared example breaking on Ruby 3.1
On Ruby 3.1, a proc with |objects, type: :x| called with a single
array argument destructures it — so objects receives the first
element instead of the full array. Ruby 3.2+ changed this behavior,
which is why the test was passing in CI (Ruby 3.3) but failed once
we pinned the local version to the minimum required Ruby (3.1.0).
Using a splat (*objects) avoids the destructuring entirely: it
collects all positional arguments into an array, so objects.first
is always the classes array regardless of Ruby version.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 58183bf commit 3de4cfc
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
0 commit comments