mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
This commit is contained in:
parent
c5c05460ac
commit
ffd0820ab3
Notes:
git
2019-11-18 08:01:15 +09:00
201 changed files with 2292 additions and 2874 deletions
|
@ -22,16 +22,18 @@ describe "Array#compact" do
|
|||
ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_an_instance_of(Array)
|
||||
end
|
||||
|
||||
it "does not keep tainted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.taint
|
||||
a.compact.tainted?.should be_false
|
||||
end
|
||||
ruby_version_is ''...'2.7' do
|
||||
it "does not keep tainted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.taint
|
||||
a.compact.tainted?.should be_false
|
||||
end
|
||||
|
||||
it "does not keep untrusted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.untrust
|
||||
a.compact.untrusted?.should be_false
|
||||
it "does not keep untrusted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.untrust
|
||||
a.compact.untrusted?.should be_false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -57,18 +59,20 @@ describe "Array#compact!" do
|
|||
[1, 2, false, 3].compact!.should == nil
|
||||
end
|
||||
|
||||
it "keeps tainted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.taint
|
||||
a.compact!
|
||||
a.tainted?.should be_true
|
||||
end
|
||||
ruby_version_is ''...'2.7' do
|
||||
it "keeps tainted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.taint
|
||||
a.compact!
|
||||
a.tainted?.should be_true
|
||||
end
|
||||
|
||||
it "keeps untrusted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.untrust
|
||||
a.compact!
|
||||
a.untrusted?.should be_true
|
||||
it "keeps untrusted status even if all elements are removed" do
|
||||
a = [nil, nil]
|
||||
a.untrust
|
||||
a.compact!
|
||||
a.untrusted?.should be_true
|
||||
end
|
||||
end
|
||||
|
||||
it "raises a #{frozen_error_class} on a frozen array" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue