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

Commit 3af7bae

Browse files
committed
Add RubyFeatures#supports_taint?
1 parent b2f4a68 commit 3af7bae

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/rspec/support/ruby_features.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ def supports_exception_cause?
9090
end
9191
end
9292

93+
if RUBY_VERSION.to_f >= 2.7
94+
def supports_taint?
95+
false
96+
end
97+
else
98+
def supports_taint?
99+
true
100+
end
101+
end
93102
ripper_requirements = [ComparableVersion.new(RUBY_VERSION) >= '1.9.2']
94103

95104
ripper_requirements.push(false) if Ruby.rbx?

spec/rspec/support/ruby_features_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ module Support
9595
RubyFeatures.supports_rebinding_module_methods?
9696
end
9797

98+
specify "#supports_taint?" do
99+
RubyFeatures.supports_taint?
100+
end
101+
98102
specify "#caller_locations_supported? exists" do
99103
RubyFeatures.caller_locations_supported?
100104
if Ruby.mri?

0 commit comments

Comments
 (0)