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:
parent
e294e6f417
commit
ad651925e3
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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue