Skip to content

Add RBS signatures from ruby/rbs repo#279

Open
sferik wants to merge 4 commits intoruby:masterfrom
sferik:add-rbs-signatures
Open

Add RBS signatures from ruby/rbs repo#279
sferik wants to merge 4 commits intoruby:masterfrom
sferik:add-rbs-signatures

Conversation

@sferik
Copy link

@sferik sferik commented Mar 6, 2026

See #278 for context.

@sferik sferik mentioned this pull request Mar 6, 2026
Copy link

@ksss ksss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code differs significantly from the ruby/rbs version, making it difficult to pinpoint the differences.
Can it be made as close to the original as possible?
If there are issues with the original, please let me know.

@sferik sferik force-pushed the add-rbs-signatures branch from 9c60307 to 1c7e9f0 Compare March 10, 2026 13:35
@sferik sferik force-pushed the add-rbs-signatures branch from 1c7e9f0 to 0533460 Compare March 10, 2026 13:41
@sferik
Copy link
Author

sferik commented Mar 10, 2026

Okay, I've copied the tests from ruby/rbs verbatim and added the rbs:annotate rake tasks to this PR.

Copy link

@ksss ksss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NetHTTPTestSigHelper and NetHTTPRBSTestCase should be removed.
This approach does not allow us to confirm if the manifest.yaml specification is sufficient.

Additionally, library should be used.
This is a DSL that explicitly states that only the specified library has been loaded.

  library "net-http"
  testing "singleton(::Net::HTTP)"

sferik added 2 commits March 10, 2026 21:55
Replace custom NetHTTPTestSigHelper/NetHTTPRBSTestCase with the
standard RBS::UnitTest library DSL, which validates that manifest.yaml
declares all required dependencies.
@sferik
Copy link
Author

sferik commented Mar 11, 2026

@ksss How does that look?

Comment on lines +1 to +9
dependencies:
- name: net-protocol
- name: open-uri
- name: openssl
- name: socket
- name: strscan
- name: timeout
- name: uri
- name: zlib
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a list of libraries required on the Ruby side, and many of them are not necessary as RBS type names.
If you haven't added types to RBS, there should be no additional type names.
Please copy it as is.

Suggested change
dependencies:
- name: net-protocol
- name: open-uri
- name: openssl
- name: socket
- name: strscan
- name: timeout
- name: uri
- name: zlib
dependencies:
- name: net-protocol
- name: uri

gem "test-unit"
gem "test-unit-ruby-core"

group :sig do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This grouping is provided to avoid affecting existing Ruby code tests.
Existing test.yml and push_gem.yml workflows should avoid installing the sig group.

    env:
      BUNDLE_WITHOUT: sig

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.

2 participants