Sha256: f76467a69207728d549e0e1a6138352fef3ace6ce26a2e6945573c73bf2eae76

Contents?: true

Size: 1020 Bytes

Versions: 34

Compression:

Stored size: 1020 Bytes

Contents

require "rspec/support/warnings"

module RSpec
  module Core
    # @private
    module Warnings
      # @private
      #
      # Used internally to print deprecation warnings
      def deprecate(deprecated, data={})
        RSpec.configuration.reporter.deprecation(
          {
            :deprecated => deprecated,
            :call_site => CallerFilter.first_non_rspec_line
          }.merge(data)
        )
      end

      # @private
      #
      # Used internally to print deprecation warnings
      def warn_deprecation(message, opts={})
        RSpec.configuration.reporter.deprecation opts.merge(:message => message)
      end

      # @private
      def warn_with(message, options={})
        if options[:use_spec_location_as_call_site]
          message += "." unless message.end_with?(".")

          if RSpec.current_example
            message += " Warning generated from spec at `#{RSpec.current_example.location}`."
          end
        end

        super(message, options)
      end
    end
  end
end

Version data entries

34 entries across 31 versions & 8 rubygems

Version Path
opal-rspec-0.8.0 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.8.0.alpha3 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.8.0.alpha2 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.8.0.alpha1 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.7.1 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.7.0 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.6.2 rspec-core/lib/rspec/core/warnings.rb
opal-rspec-0.7.0.rc.2 rspec-core/upstream/lib/rspec/core/warnings.rb
opal-rspec-0.6.1 rspec-core/lib/rspec/core/warnings.rb
opal-rspec-0.6.0 rspec-core/lib/rspec/core/warnings.rb
opal-rspec-0.6.0.beta1 rspec-core/lib/rspec/core/warnings.rb
opal-connect-rspec-0.5.0 rspec-core/lib/rspec/core/warnings.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/rspec-core-3.1.7/lib/rspec/core/warnings.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rspec-core-3.1.1/lib/rspec/core/warnings.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rspec-core-3.1.1/lib/rspec/core/warnings.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rspec-core-3.1.1/lib/rspec/core/warnings.rb
opal-rspec-0.5.0 rspec-core/lib/rspec/core/warnings.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/rspec-core-3.1.7/lib/rspec/core/warnings.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/rspec-core-3.1.7/lib/rspec/core/warnings.rb
logstash-codec-json-2.0.3 vendor/gems/rspec-core-3.1.7/lib/rspec/core/warnings.rb