1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add Data class implementation: Simple immutable value object

This commit is contained in:
Victor Shepelev 2022-09-30 12:23:19 +03:00 committed by GitHub
parent e294e6f417
commit ad651925e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-09-30 18:23:54 +09:00
Merged: https://github.com/ruby/ruby/pull/6353

Merged-By: nobu <nobu@ruby-lang.org>
6 changed files with 716 additions and 6 deletions

View file

@ -14,10 +14,22 @@ ruby_version_is ''...'3.0' do
end
end
ruby_version_is '3.0' do
ruby_version_is '3.0'...'3.2' do
describe "Data" do
it "does not exist anymore" do
Object.should_not have_constant(:Data)
end
end
end
ruby_version_is '3.2' do
describe "Data" do
it "is a new constant" do
Data.superclass.should == Object
end
it "is not deprecated" do
-> { Data }.should_not complain
end
end
end