diff options
Diffstat (limited to 'spec/ruby/optional/capi/string_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/string_spec.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/spec/ruby/optional/capi/string_spec.rb b/spec/ruby/optional/capi/string_spec.rb index 1cfd590ca4..53d28f7940 100644 --- a/spec/ruby/optional/capi/string_spec.rb +++ b/spec/ruby/optional/capi/string_spec.rb @@ -558,20 +558,22 @@ describe "C-API String function" do end describe "SafeStringValue" do - it "raises for tained string when $SAFE is 1" do - begin - Thread.new { - $SAFE = 1 - -> { - @s.SafeStringValue("str".taint) - }.should raise_error(SecurityError) - }.join - ensure - $SAFE = 0 + ruby_version_is ''...'2.7' do + it "raises for tained string when $SAFE is 1" do + begin + Thread.new { + $SAFE = 1 + -> { + @s.SafeStringValue("str".taint) + }.should raise_error(SecurityError) + }.join + ensure + $SAFE = 0 + end end - end - it_behaves_like :string_value_macro, :SafeStringValue + it_behaves_like :string_value_macro, :SafeStringValue + end end describe "rb_str_modify_expand" do |