Skip to content

Commit

Permalink
Merge pull request #395 from bjfish/update-ripper-helper-and-spec
Browse files Browse the repository at this point in the history
Update ripper_supported? for truffleruby and ripper specs
  • Loading branch information
JonRowe committed Jan 14, 2020
2 parents b83b4ce + 6ae5540 commit 54f601f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/rspec/support/ruby_features.rb
Expand Up @@ -47,6 +47,10 @@ def non_mri?
def mri?
!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
end

def truffleruby?
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby'
end
end

# @api private
Expand Down Expand Up @@ -101,7 +105,7 @@ def supports_taint?
end
ripper_requirements = [ComparableVersion.new(RUBY_VERSION) >= '1.9.2']

ripper_requirements.push(false) if Ruby.rbx?
ripper_requirements.push(false) if Ruby.rbx? || Ruby.truffleruby?

if Ruby.jruby?
ripper_requirements.push(Ruby.jruby_version >= '1.7.5')
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/support/ruby_features_spec.rb
Expand Up @@ -111,7 +111,7 @@ def ripper_is_implemented?
in_sub_process_if_possible do
begin
require 'ripper'
!!defined?(::Ripper)
!!defined?(::Ripper) && Ripper.respond_to?(:lex)
rescue LoadError
false
end
Expand Down

0 comments on commit 54f601f

Please sign in to comment.