Sha256: f0030857ced9233378d30dd1eae56146371e4c3cb5a126b90795e83fb4b3216b

Contents?: true

Size: 959 Bytes

Versions: 7

Compression:

Stored size: 959 Bytes

Contents

module RSpec

  unless respond_to?(:deprecate)

    # @private
    #
    # Used internally to print deprecation warnings
    # when rspec-core isn't loaded
    def self.deprecate(deprecated, options = {})
      warn_with "DEPRECATION: #{deprecated} is deprecated.", options
    end
  end

  unless respond_to?(:warn_deprecation)

    # @private
    #
    # Used internally to print deprecation warnings
    # when rspec-core isn't loaded
    def self.warn_deprecation(message)
      warn_with "DEPRECATION: \n #{message}"
    end
  end

  # @private
  #
  # Used internally to print warnings
  def self.warning(text, options={})
    warn_with "WARNING: #{text}.", options
  end

  # @private
  #
  # Used internally to print longer warnings
  def self.warn_with(message, options = {})
    call_site = options.fetch(:call_site) { CallerFilter.first_non_rspec_line }
    message << " Called from #{call_site}." if call_site
    ::Kernel.warn message
  end

end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
opal-rspec-cj-0.4.4 vendor_lib/rspec/support/warnings.rb
opal-rspec-0.4.3 vendor_lib/rspec/support/warnings.rb
opal-rspec-0.4.2 vendor_lib/rspec/support/warnings.rb
opal-rspec-0.4.1 vendor_lib/rspec/support/warnings.rb
opal-rspec-0.4.0 vendor_lib/rspec/support/warnings.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/support/warnings.rb
rspec-support-3.0.0.beta1 lib/rspec/support/warnings.rb