diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-09-24 20:59:12 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-11-18 01:00:25 +0200 |
commit | ffd0820ab317542f8780aac475da590a4bdbc7a8 (patch) | |
tree | 6a5d774933c15fd2b9ea948bd3ae2fa587faaf82 /test/pathname | |
parent | c5c05460ac20abcbc0ed686eb4acf06da7a39a79 (diff) | |
download | ruby-ffd0820ab317542f8780aac475da590a4bdbc7a8.tar.gz |
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.
Diffstat (limited to 'test/pathname')
-rw-r--r-- | test/pathname/test_pathname.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 4d480a50f3..792510bdfb 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -592,39 +592,6 @@ class TestPathname < Test::Unit::TestCase assert_raise(ArgumentError) { Pathname.new("\0") } end - def test_taint - obj = Pathname.new("a"); assert_same(obj, obj.taint) - obj = Pathname.new("a"); assert_same(obj, obj.untaint) - - assert_equal(false, Pathname.new("a" ) .tainted?) - assert_equal(false, Pathname.new("a" ) .to_s.tainted?) - assert_equal(true, Pathname.new("a" ).taint .tainted?) - assert_equal(true, Pathname.new("a" ).taint.to_s.tainted?) - assert_equal(true, Pathname.new("a".dup.taint) .tainted?) - assert_equal(true, Pathname.new("a".dup.taint) .to_s.tainted?) - assert_equal(true, Pathname.new("a".dup.taint).taint .tainted?) - assert_equal(true, Pathname.new("a".dup.taint).taint.to_s.tainted?) - - str = "a".dup - path = Pathname.new(str) - str.taint - assert_equal(false, path .tainted?) - assert_equal(false, path.to_s.tainted?) - end - - def test_untaint - obj = Pathname.new("a"); assert_same(obj, obj.untaint) - - assert_equal(false, Pathname.new("a").taint.untaint .tainted?) - assert_equal(false, Pathname.new("a").taint.untaint.to_s.tainted?) - - str = "a".dup.taint - path = Pathname.new(str) - str.untaint - assert_equal(true, path .tainted?) - assert_equal(true, path.to_s.tainted?) - end - def test_freeze obj = Pathname.new("a"); assert_same(obj, obj.freeze) @@ -638,20 +605,6 @@ class TestPathname < Test::Unit::TestCase assert_equal(false, Pathname.new("a".freeze).freeze.to_s.frozen?) end - def test_freeze_and_taint - obj = Pathname.new("a") - obj.freeze - assert_equal(false, obj.tainted?) - assert_raise(FrozenError) { obj.taint } - - obj = Pathname.new("a") - obj.taint - assert_equal(true, obj.tainted?) - obj.freeze - assert_equal(true, obj.tainted?) - assert_nothing_raised { obj.taint } - end - def test_to_s str = "a" obj = Pathname.new(str) |