Skip to content

Commit

Permalink
Merge pull request #2684 from bjfish/ignore-safe-when-not-mri
Browse files Browse the repository at this point in the history
Only set $SAFE for MRI in spec helper
  • Loading branch information
pirj committed Jan 9, 2020
2 parents 7c2531e + f357247 commit 1174cc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/support/helper_methods.rb
Expand Up @@ -15,8 +15,9 @@ def ignoring_warnings
end

# In Ruby 2.7 taint was removed and has no effect, whilst SAFE warns that it
# has no effect and will become a normal varible in 3.0.
if RUBY_VERSION >= '2.7'
# has no effect and will become a normal varible in 3.0. Other engines do not
# implement SAFE.
if RUBY_VERSION >= '2.7' || (defined?(RUBY_ENGINE) && RUBY_ENGINE != "ruby")
def with_safe_set_to_level_that_triggers_security_errors
yield
end
Expand Down

0 comments on commit 1174cc5

Please sign in to comment.