summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authorVictor Shepelev <zverok.offline@gmail.com>2022-09-30 12:23:19 +0300
committerGitHub <noreply@github.com>2022-09-30 18:23:19 +0900
commitad651925e365ca18645f05b5e9b2eca9cd5721bc (patch)
tree37536bfdd4a35061505d1364fc6a084140ba5a30 /spec/ruby
parente294e6f417acc27d85c6e6a0e67ebf7a07c83485 (diff)
Add Data class implementation: Simple immutable value object
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6353 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/data/constants_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/ruby/core/data/constants_spec.rb b/spec/ruby/core/data/constants_spec.rb
index 1d469f9237..d9d55b50f9 100644
--- a/spec/ruby/core/data/constants_spec.rb
+++ b/spec/ruby/core/data/constants_spec.rb
@@ -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