Ruby 4.0: Add specs for Range#to_set#1319
Merged
eregon merged 1 commit intoruby:masterfrom Jan 4, 2026
Merged
Conversation
eregon
reviewed
Jan 4, 2026
Comment on lines
+36
to
+42
| it "does not need explicit `require 'set'`" do | ||
| output = ruby_exe(<<~RUBY, options: '--disable-gems', args: '2>&1') | ||
| puts (1..3).to_set.to_a.inspect | ||
| RUBY | ||
|
|
||
| output.chomp.should == "[1, 2, 3]" | ||
| end |
Member
There was a problem hiding this comment.
I'm not sure what this spec achieves, that to_set works even if set isn't required?
It can't really test if to_set does or not require/autoload Set under the hood.
So I'm hesitating whether this is worth keeping, partly because ruby_exe tests are slow and the value seems minimal here, since Set being always available is or should be tested elsewhere.
Member
Author
There was a problem hiding this comment.
It was a copy-paste from core/enumerable/to_set_spec.rb, but that one has been removed in commit d871546
I think these specs started as a way to test the autoload in Ruby 3.2, but since Ruby 3.2 is now the minimal version and we don't require set anywhere in the specs, it should probably be okay to just remove it.
eregon
approved these changes
Jan 4, 2026
eregon
added a commit
that referenced
this pull request
Jan 4, 2026
* See #1319 (comment) for details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.