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

Commit e15e4a8

Browse files
committed
Update ripper_supported? for truffleruby and ripper specs to only run when supported
1 parent 596198a commit e15e4a8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/rspec/support/ruby_features.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def non_mri?
4747
def mri?
4848
!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
4949
end
50+
51+
def truffleruby?
52+
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby'
53+
end
5054
end
5155

5256
# @api private
@@ -101,7 +105,7 @@ def supports_taint?
101105
end
102106
ripper_requirements = [ComparableVersion.new(RUBY_VERSION) >= '1.9.2']
103107

104-
ripper_requirements.push(false) if Ruby.rbx?
108+
ripper_requirements.push(false) if Ruby.rbx? || Ruby.truffleruby?
105109

106110
if Ruby.jruby?
107111
ripper_requirements.push(Ruby.jruby_version >= '1.7.5')

spec/rspec/support/ruby_features_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def ripper_can_parse_source_including_keywordish_symbol?
145145
end
146146

147147
it 'returns whether Ripper is correctly implemented in the current environment' do
148-
expect(RubyFeatures.ripper_supported?).to eq(ripper_is_implemented? && ripper_works_correctly?)
148+
expect(RubyFeatures.ripper_supported?).to eq(RubyFeatures.ripper_supported? && ripper_is_implemented? && ripper_works_correctly?)
149149
end
150150

151151
it 'does not load Ripper' do

0 commit comments

Comments
 (0)