Skip to content

Commit 1e9556d

Browse files
apiologyclaude
andcommitted
Fix push-argument spec to not depend on RBS param name
CI runs the matrix against RBS 3.10.0 through 4.0.2, where Array#push's restarg parameter is named differently (e.g. `obj`) than in the RBS version used locally (`objects`). The parameter name is an incidental detail of the core RBS declaration, not something this PR's type-checking logic controls, so match on the substance of the message instead of the exact name. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCTZUQv2ijSU5Cqgw4CU1f
1 parent 8e94b1c commit 1e9556d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

spec/type_checker/levels/strict_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ def foo str; end
6666
y = [1]
6767
y.push 'two'
6868
))
69+
# The restarg's parameter name (`objects`, `obj`, etc.) varies
70+
# across core RBS versions, so match on the substance of the
71+
# message rather than the exact name.
6972
expect(checker.problems.map(&:message))
70-
.to eq(['Wrong argument type for Array#push: objects expected Integer, received String'])
73+
.to contain_exactly(a_string_matching(/\AWrong argument type for Array#push: \w+ expected Integer, received String\z/))
7174
end
7275

7376
it 'handles compatible interfaces with self types on call' do

0 commit comments

Comments
 (0)