# File lib/rspec/support/warnings.rb, line 4 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
# File lib/rspec/support/warnings.rb, line 12 def warn_deprecation(message, options = {}) warn_with "DEPRECATION: \n #{message}", options end
@private
Used internally to print longer warnings
# File lib/rspec/support/warnings.rb, line 26 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 ::Kernel.warn message end
@private
Used internally to print warnings
# File lib/rspec/support/warnings.rb, line 19 def warning(text, options={}) warn_with "WARNING: #{text}.", options end