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)


26
27
28
# File 'lib/rspec/support/ruby_features.rb', line 26

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)


38
39
40
# File 'lib/rspec/support/ruby_features.rb', line 38

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)


34
35
36
# File 'lib/rspec/support/ruby_features.rb', line 34

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)


30
31
32
# File 'lib/rspec/support/ruby_features.rb', line 30

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