Sha256: 798c289d152fa1e806894d2bb3b8b6fbb4d659127f67748aea698f07999cea0a

Contents?: true

Size: 1.1 KB

Versions: 2378

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

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

2,378 entries across 2,377 versions & 19 rubygems

Version Path
cybrid_api_id_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_id_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_id_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_id_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_id_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_id_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_bank_ruby-0.123.302 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb
cybrid_api_organization_ruby-0.123.302 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/warnings.rb