Skip to content

Load sig/ of this repository in signature tests - #74

Open
ksss wants to merge 1 commit into
ruby:masterfrom
ksss:load-own-sig
Open

ksss wants to merge 1 commit into
ruby:masterfrom
ksss:load-own-sig

Conversation

@ksss

@ksss ksss commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The Gemfile has no gemspec, so base64 itself is not in the bundle. library 'base64' in test_sig/test_base64.rb then fails to find the gem, and RBS silently falls back to the copy of the signature bundled in rbs's stdlib/base64/0. As a result, rake rbs:test does not test sig/base64.rbs at all: it still passes even if sig/base64.rbs has a syntax error.

Fix

Add gemspec back to the Gemfile.

It was removed in 55c6b8a (2020), when the gemspec still contained bundle gem template TODOs and Bundler 2.1 strictly validated path gemspecs, which made bundle install fail. The gemspec has since been fixed and Bundler no longer validates it that strictly, so it can be restored.

Verification

With bundle config set with sig:

  • RBS::EnvironmentLoader.gem_sig_path("base64", nil) now points to this repository's sig/
  • rake rbs:test and rake test pass
  • Changing the return type of encode64 in sig/base64.rbs to Integer makes rake rbs:test fail (before this change it still passed)

The same fix was made in ruby/abbrev#15.

🤖 Generated with Claude Code

Without `gemspec` in the Gemfile, base64 is not part of the bundle, so
`library 'base64'` in test_sig cannot find this gem and RBS silently
falls back to the copy bundled in rbs's stdlib. The signature tests
were therefore not testing sig/base64.rbs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant