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

Commit 809a164

Browse files
authored
Merge pull request #571 from rspec/supports_syntax_suggest
Add RubyFeatures#supports_syntax_suggest?
2 parents a92680d + ba795f8 commit 809a164

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/rspec/support/ruby_features.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ def supports_exception_cause?
9494
end
9595
end
9696

97+
if RUBY_VERSION.to_f >= 3.2
98+
def supports_syntax_suggest?
99+
true
100+
end
101+
else
102+
def supports_syntax_suggest?
103+
false
104+
end
105+
end
106+
97107
if RUBY_VERSION.to_f >= 2.7
98108
def supports_taint?
99109
false

spec/rspec/support/ruby_features_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ module Support
9999
RubyFeatures.supports_rebinding_module_methods?
100100
end
101101

102+
specify "#supports_syntax_suggest?" do
103+
expect(RubyFeatures.supports_syntax_suggest?).to eq(RUBY_VERSION.to_f >= 3.2)
104+
end
105+
102106
specify "#supports_taint?" do
103107
RubyFeatures.supports_taint?
104108
end

0 commit comments

Comments
 (0)