From 4dc6282eb24c0117a012d07744ea1bbcae1b3a79 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 4 Oct 2019 09:06:44 -0700 Subject: [PATCH] Skip a taint test on Ruby 2.7 Ruby 2.7 is deprecating taint, and taint will no longer have an effect. See https://bugs.ruby-lang.org/issues/16131. This just skips the test for FileList#clone and #dup copying the taint flag on Ruby 2.7+. --- test/test_rake_file_list.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 853ebc8d9..eda55d29f 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -496,13 +496,15 @@ def test_clone_and_dup assert_equal ["a", "b", "c"], d end - def test_dup_and_clone_replicate_taint - a = FileList["a", "b", "c"] - a.taint - c = a.clone - d = a.dup - assert c.tainted?, "Clone should be tainted" - assert d.tainted?, "Dup should be tainted" + if RUBY_VERSION < '2.7' + def test_dup_and_clone_replicate_taint + a = FileList["a", "b", "c"] + a.taint + c = a.clone + d = a.dup + assert c.tainted?, "Clone should be tainted" + assert d.tainted?, "Dup should be tainted" + end end def test_duped_items_will_thaw