ruby / spec

The Ruby Spec Suite aka ruby/spec
MIT License
586 stars 383 forks source link

Write specs for new Ruby 3.2 features and changes #1016

Open eregon opened 1 year ago

eregon commented 1 year ago

ruby/spec already contains some specs for 3.2, but we should aim to cover all new features and important changes. This will improve the test coverage of these features (and maybe discover a few bugs along the way), allow other Ruby implementations to implement the changes faster with more confidence and document clearly the new behavior.

The new specs should be within a version guard block:

ruby_version_is "3.2" do
  # New specs
end

NOTE: https://rubyreferences.github.io/rubychanges/3.2.html gives more details for many features and changes.

From https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.2.0.md:

NEWS for Ruby 3.2.0

This document is a list of user-visible feature changes since the 3.1.0 release, except for bug fixes.

Note that each entry is kept to a minimum, see links for details.

Language changes

Core classes updates

Note: We're only listing outstanding class updates.

Fiber

Fiber::Scheduler

IO

Class

Data

Encoding

Enumerator

Exception

Hash

Integer

Kernel

MatchData

Module

Proc

Process

Regexp

Refinement

Set

String

Struct

Thread

Thread::Queue

Thread::SizedQueue

Time

SyntaxError

TracePoint

UnboundMethod

Stdlib updates

Bundler

RubyGems

CGI

Coverage

Date

ERB

FileUtils

IRB

Net::Protocol

Pathname

Socket

SyntaxSuggest

UNIXSocket

See GitHub releases like GitHub Releases of Logger or changelog for details of the default gems or bundled gems.

Compatibility issues

Removed constants

The following deprecated constants are removed.

Removed methods

The following deprecated methods are removed.

Error printer

Constant lookup when defining a class/module

Stdlib compatibility issues

C API updates

Added C APIs

Removed C APIs

The following deprecated APIs are removed.

Implementation improvements

AI-Mozi commented 1 year ago

If I'm not wrong there are some specs already implemented that can be marked as done here like Class#attached_object, Hash#shift, Integer#ceildiv, Module#const_added, Proc#parameters, String#dedup and probably few more.

andrykonchin commented 1 year ago

Thank you. Marked the mentioned methods as completed.

AI-Mozi commented 1 year ago

Another batch of implemented ones:

andrykonchin commented 1 year ago

Thank you, I've updated the tasks.

Encoding#replicate has been deprecated and will be removed in 3.3.

There is a test case that checks the method is removed in Ruby 3.3 but we still need a test that it causes warning in Ruby 3.2

herwinw commented 9 months ago

Update Unicode to Version 15.0.0 and Emoji Version 15.0. [Feature #18639]

It looks like that one has been covered in commit 8caf02ddc1d951425a5eea35fe93d5a1492f9c3a

herwinw commented 8 months ago

Introduce IO.new(..., path:) and promote File#path to IO#path. [Feature #19036]

This looks to be covered in commit 62c1bbe88028961acd8fc059c3d14c24a95e0316

andrykonchin commented 8 months ago

Thank you, marked as done.