Skip to content

Commit

Permalink
Only set $SAFE for MRI in spec helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Jan 7, 2020
1 parent 0d27b29 commit f357247
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/support/helper_methods.rb
Original file line number Diff line number Diff line change
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 f357247

Please sign in to comment.