From ffd0820ab317542f8780aac475da590a4bdbc7a8 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 24 Sep 2019 20:59:12 -0700 Subject: 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. --- spec/ruby/language/string_spec.rb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'spec/ruby/language/string_spec.rb') diff --git a/spec/ruby/language/string_spec.rb b/spec/ruby/language/string_spec.rb index a7ca00ef03..d0f62ff3c9 100644 --- a/spec/ruby/language/string_spec.rb +++ b/spec/ruby/language/string_spec.rb @@ -51,24 +51,26 @@ describe "Ruby character strings" do "#\$".should == '#$' end - it "taints the result of interpolation when an interpolated value is tainted" do - "#{"".taint}".tainted?.should be_true + ruby_version_is ''...'2.7' do + it "taints the result of interpolation when an interpolated value is tainted" do + "#{"".taint}".tainted?.should be_true - @ip.taint - "#@ip".tainted?.should be_true + @ip.taint + "#@ip".tainted?.should be_true - $ip.taint - "#$ip".tainted?.should be_true - end + $ip.taint + "#$ip".tainted?.should be_true + end - it "untrusts the result of interpolation when an interpolated value is untrusted" do - "#{"".untrust}".untrusted?.should be_true + it "untrusts the result of interpolation when an interpolated value is untrusted" do + "#{"".untrust}".untrusted?.should be_true - @ip.untrust - "#@ip".untrusted?.should be_true + @ip.untrust + "#@ip".untrusted?.should be_true - $ip.untrust - "#$ip".untrusted?.should be_true + $ip.untrust + "#$ip".untrusted?.should be_true + end end it "allows using non-alnum characters as string delimiters" do -- cgit v1.2.3