Sha256: e5e99813cd8abf651520dd3c3b78c03a46171f8519c1ba1a3d7defdae12dc85c

Contents?: true

Size: 1.27 KB

Versions: 24

Compression:

Stored size: 1.27 KB

Contents

module RSpec
  module Support
    # @api private
    #
    # Provides query methods for different rubies
    module Ruby
      def jruby?
        RUBY_PLATFORM == 'java'
      end
      module_function :jruby?
    end

    # @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

24 entries across 23 versions & 7 rubygems

Version Path
opal-rspec-0.8.0 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.8.0.alpha3 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.8.0.alpha2 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.8.0.alpha1 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.7.1 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.7.0 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.6.2 rspec-support/lib/rspec/support/ruby_features.rb
opal-rspec-0.7.0.rc.2 rspec-support/upstream/lib/rspec/support/ruby_features.rb
opal-rspec-0.6.1 rspec-support/lib/rspec/support/ruby_features.rb
opal-rspec-0.6.0 rspec-support/lib/rspec/support/ruby_features.rb
opal-rspec-0.6.0.beta1 rspec-support/lib/rspec/support/ruby_features.rb
opal-connect-rspec-0.5.0 rspec-support/lib/rspec/support/ruby_features.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb
opal-rspec-0.5.0 rspec-support/lib/rspec/support/ruby_features.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb
logstash-codec-json-2.0.3 vendor/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb
opal-rspec-0.5.0.beta3 rspec-support/lib/rspec/support/ruby_features.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/ruby_features.rb