diff options
Diffstat (limited to 'spec/ruby/core/kernel/untrust_spec.rb')
-rw-r--r-- | spec/ruby/core/kernel/untrust_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/untrust_spec.rb b/spec/ruby/core/kernel/untrust_spec.rb index fca7c9ea47..aff0fec57b 100644 --- a/spec/ruby/core/kernel/untrust_spec.rb +++ b/spec/ruby/core/kernel/untrust_spec.rb @@ -24,4 +24,19 @@ describe "Kernel#untrust" do o.untrust.should equal(o) end end + + ruby_version_is "2.7"..."3.0" do + it "is a no-op" do + o = Object.new + o.untrust + o.should_not.untrusted? + end + + it "warns in verbose mode" do + -> { + o = Object.new + o.untrust + }.should complain(/Object#untrust is deprecated and will be removed in Ruby 3.2/, verbose: true) + end + end end |