Module: RSpec::Support::RubyFeatures 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 ruby features that differ among implementations.
Class Method Summary collapse
- .caller_locations_supported? ⇒ Boolean private
- .module_prepends_supported? ⇒ Boolean private
- .optional_and_splat_args_supported? ⇒ Boolean private
Instance Method Summary collapse
- #kw_args_supported? ⇒ Boolean private
- #required_kw_args_supported? ⇒ Boolean private
- #ripper_supported? ⇒ Boolean private
- #supports_exception_cause? ⇒ Boolean private
- #supports_rebinding_module_methods? ⇒ Boolean private
Class Method Details
.caller_locations_supported? ⇒ 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.
55 56 57 |
# File 'lib/rspec/support/ruby_features.rb', line 55 def caller_locations_supported? respond_to?(:caller_locations, true) end |
.module_prepends_supported? ⇒ 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.
142 143 144 |
# File 'lib/rspec/support/ruby_features.rb', line 142 def module_prepends_supported? Module.method_defined?(:prepend) || Module.private_method_defined?(:prepend) end |
.optional_and_splat_args_supported? ⇒ 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.
51 52 53 |
# File 'lib/rspec/support/ruby_features.rb', line 51 def optional_and_splat_args_supported? Method.method_defined?(:parameters) end |
Instance Method Details
#kw_args_supported? ⇒ 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.
88 89 90 |
# File 'lib/rspec/support/ruby_features.rb', line 88 def kw_args_supported? RUBY_VERSION >= '2.0.0' end |
#required_kw_args_supported? ⇒ 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.
92 93 94 |
# File 'lib/rspec/support/ruby_features.rb', line 92 def required_kw_args_supported? RUBY_VERSION >= '2.1.0' end |
#ripper_supported? ⇒ 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.
78 79 80 |
# File 'lib/rspec/support/ruby_features.rb', line 78 def ripper_supported? true end |
#supports_exception_cause? ⇒ 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.
60 61 62 |
# File 'lib/rspec/support/ruby_features.rb', line 60 def supports_exception_cause? true end |
#supports_rebinding_module_methods? ⇒ 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.
96 97 98 |
# File 'lib/rspec/support/ruby_features.rb', line 96 def supports_rebinding_module_methods? RUBY_VERSION.to_i >= 2 end |