Skip to content

Commit

Permalink
Skip a taint test on Ruby 2.7
Browse files Browse the repository at this point in the history
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+.
  • Loading branch information
jeremyevans committed Oct 4, 2019
1 parent a08b697 commit 4dc6282
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/test_rake_file_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4dc6282

Please sign in to comment.