Module: RSpec::Support::Warnings
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | rspec-support/lib/rspec/support/warnings.rb |
Instance Method Summary
- #deprecate(deprecated, options = {})
-
#warn_deprecation(message, options = {})
Internal use only
Internal use only
Used internally to print deprecation warnings when rspec-core isn’t loaded.
-
#warn_with(message, options = {})
Internal use only
Internal use only
Used internally to print longer warnings.
-
#warning(text, options = {})
Internal use only
Internal use only
Used internally to print warnings.
Instance Method Details
#deprecate(deprecated, options = {})
[ GitHub ]# File 'rspec-support/lib/rspec/support/warnings.rb', line 9
def deprecate(deprecated, ={}) warn_with "DEPRECATION: #{deprecated} is deprecated.", end
#warn_deprecation(message, options = {})
This method is for internal use only.
Used internally to print deprecation warnings when rspec-core isn’t loaded
# File 'rspec-support/lib/rspec/support/warnings.rb', line 17
def warn_deprecation(, ={}) warn_with "DEPRECATION: \n #{}", end
#warn_with(message, options = {})
This method is for internal use only.
Used internally to print longer warnings
# File 'rspec-support/lib/rspec/support/warnings.rb', line 31
def warn_with(, ={}) call_site = .fetch(:call_site) { CallerFilter.first_non_rspec_line } += " Use #{ [:replacement]} instead." if [:replacement] += " Called from #{call_site}." if call_site Support.warning_notifier.call end
#warning(text, options = {})
This method is for internal use only.
Used internally to print warnings
# File 'rspec-support/lib/rspec/support/warnings.rb', line 24
def warning(text, ={}) warn_with "WARNING: #{text}.", end