Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 29be0cc

Browse files
committed
Fix failing specs caused by $SAFE incompatibility on MRI 2.3
ArgumentError: $SAFE=2 to 4 are obsolete
1 parent a9f9d5a commit 29be0cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/support/helper_methods.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module RSpecHelpers
2+
SAFE_LEVEL_THAT_TRIGGERS_SECURITY_ERRORS = RUBY_VERSION >= '2.3' ? 1 : 3
3+
24
def relative_path(path)
35
RSpec::Core::Metadata.relative_path(path)
46
end
@@ -13,7 +15,7 @@ def ignoring_warnings
1315

1416
def with_safe_set_to_level_that_triggers_security_errors
1517
Thread.new do
16-
ignoring_warnings { $SAFE = 3 }
18+
ignoring_warnings { $SAFE = SAFE_LEVEL_THAT_TRIGGERS_SECURITY_ERRORS }
1719
yield
1820
end.join
1921

0 commit comments

Comments
 (0)