Module: RSpec::Support::Warnings
- Included in:
- RSpec
- Defined in:
- opal/opal/rspec/fixes/rspec/support/warnings.rb
Instance Method Summary collapse
- #warn_with(message, options = {}) ⇒ Object (also: #support_warn_with)
Instance Method Details
#warn_with(message, options = {}) ⇒ Object Also known as: support_warn_with
4 5 6 7 8 9 10 11 12 |
# File 'opal/opal/rspec/fixes/rspec/support/warnings.rb', line 4 def warn_with(, ={}) call_site = .fetch(:call_site) { CallerFilter.first_non_rspec_line } # mutable strings # message << " Use #{options[:replacement]} instead." if options[:replacement] += " Use #{[:replacement]} instead." if [:replacement] # message << " Called from #{call_site}." if call_site += " Called from #{call_site}." if call_site ::Kernel.warn end |