diff --git a/core/kernel/trust_spec.rb b/core/kernel/trust_spec.rb index 4665036da..5cb1f61a1 100644 --- a/core/kernel/trust_spec.rb +++ b/core/kernel/trust_spec.rb @@ -17,4 +17,12 @@ }.should complain(/Object#trust is deprecated and will be removed in Ruby 3.2/, verbose: true) end end + + ruby_version_is "3.2" do + it "has been removed" do + -> { + Object.new.trust + }.should raise_error(NoMethodError, /undefined method `trust' for/) + end + end end diff --git a/core/kernel/untrust_spec.rb b/core/kernel/untrust_spec.rb index ba0e073cf..b41de6354 100644 --- a/core/kernel/untrust_spec.rb +++ b/core/kernel/untrust_spec.rb @@ -16,4 +16,12 @@ }.should complain(/Object#untrust is deprecated and will be removed in Ruby 3.2/, verbose: true) end end + + ruby_version_is "3.2" do + it "has been removed" do + -> { + Object.new.untrust + }.should raise_error(NoMethodError, /undefined method `untrust' for/) + end + end end diff --git a/core/kernel/untrusted_spec.rb b/core/kernel/untrusted_spec.rb index 517bd4711..8987a4c56 100644 --- a/core/kernel/untrusted_spec.rb +++ b/core/kernel/untrusted_spec.rb @@ -17,4 +17,12 @@ }.should complain(/Object#untrusted\? is deprecated and will be removed in Ruby 3.2/, verbose: true) end end + + ruby_version_is "3.2" do + it "has been removed" do + -> { + Object.new.untrusted? + }.should raise_error(NoMethodError, /undefined method `untrusted?/) + end + end end