Sha256: 0a48cb2cb854dab5e0d6e74750f01a121293c7332cff5673c7c518514e5d47eb

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module RSpec
  module Support
    # @api private
    #
    # Provides query methods for ruby features that differ among
    # implementations.
    module RubyFeatures
      def optional_and_splat_args_supported?
        Method.method_defined?(:parameters)
      end
      module_function :optional_and_splat_args_supported?

      def kw_args_supported?
        RUBY_VERSION >= '2.0.0' && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
      end
      module_function :kw_args_supported?

      def required_kw_args_supported?
        RUBY_VERSION >= '2.1.0' && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
      end
      module_function :required_kw_args_supported?

      def module_prepends_supported?
        Module.method_defined?(:prepend) || Module.private_method_defined?(:prepend)
      end
      module_function :module_prepends_supported?

      def supports_rebinding_module_methods?
        # RBX and JRuby don't yet support this.
        RUBY_VERSION.to_i >= 2 && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
      end
      module_function :supports_rebinding_module_methods?
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rspec-support-3.1.0/lib/rspec/support/ruby_features.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rspec-support-3.1.0/lib/rspec/support/ruby_features.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rspec-support-3.1.0/lib/rspec/support/ruby_features.rb
rspec-support-3.1.1 lib/rspec/support/ruby_features.rb
rspec-support-3.1.0 lib/rspec/support/ruby_features.rb
rspec-support-3.0.4 lib/rspec/support/ruby_features.rb
rspec-support-3.0.3 lib/rspec/support/ruby_features.rb