Sha256: 65144f84edd591b35e85a828dcfb233de052059000c095d3d0cba0b44c0f2d86

Contents?: true

Size: 1.07 KB

Versions: 116

Compression:

Stored size: 1.07 KB

Contents

require 'rspec/support'
RSpec::Support.require_rspec_support "caller_filter"

module RSpec
  module Support
    module Warnings
      def deprecate(deprecated, options={})
        warn_with "DEPRECATION: #{deprecated} is deprecated.", options
      end

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

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

      # @private
      #
      # Used internally to print longer warnings
      def warn_with(message, options={})
        call_site = options.fetch(:call_site) { CallerFilter.first_non_rspec_line }
        message << " Use #{options[:replacement]} instead." if options[:replacement]
        message << " Called from #{call_site}." if call_site
        Support.warning_notifier.call message
      end
    end
  end

  extend RSpec::Support::Warnings
end

Version data entries

116 entries across 106 versions & 30 rubygems

Version Path
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/rspec-support-3.5.0/lib/rspec/support/warnings.rb