Module: RSpec::Support::Ruby Private

Defined in:
lib/rspec/support/ruby_features.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides query methods for different rubies

Class Method Summary collapse

Class Method Details

.jruby?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


24
25
26
# File 'lib/rspec/support/ruby_features.rb', line 24

def jruby?
  RUBY_PLATFORM == 'java'
end

.mri?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


36
37
38
# File 'lib/rspec/support/ruby_features.rb', line 36

def mri?
  !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
end

.non_mri?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


32
33
34
# File 'lib/rspec/support/ruby_features.rb', line 32

def non_mri?
  !mri?
end

.rbx?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


28
29
30
# File 'lib/rspec/support/ruby_features.rb', line 28

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