module RSpec
Public Class Methods
deprecate(deprecated, options = {})
click to toggle source
@private
Used internally to print deprecation warnings when rspec-core isn't loaded
# File lib/rspec/support/warnings.rb, line 9 def self.deprecate(deprecated, options = {}) warn_with "DEPRECATION: #{deprecated} is deprecated.", options end
warn_deprecation(message)
click to toggle source
@private
Used internally to print deprecation warnings when rspec-core isn't loaded
# File lib/rspec/support/warnings.rb, line 20 def self.warn_deprecation(message) warn_with "DEPRECATION: \n #{message}" end
warn_with(message, options = {})
click to toggle source
@private
Used internally to print longer warnings
# File lib/rspec/support/warnings.rb, line 35 def self.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
warning(text, options={})
click to toggle source
@private
Used internally to print warnings
# File lib/rspec/support/warnings.rb, line 28 def self.warning(text, options={}) warn_with "WARNING: #{text}.", options end