Method: RSpec::Core::Configuration#raise_on_warning=

Defined in:
lib/rspec/core/configuration.rb

#raise_on_warning=(value) ⇒ void

Turns RSpec warnings into errors. This can be useful when you want RSpec to run in a 'strict' no warning situation. (Note this does not capture or raise on Ruby warnings).

Examples:


RSpec.configure do |rspec|
  rspec.raise_on_warning = true
end


1781
1782
1783
1784
1785
1786
1787
# File 'lib/rspec/core/configuration.rb', line 1781

def raise_on_warning=(value)
  if value
    RSpec::Support.warning_notifier = RAISE_ERROR_WARNING_NOTIFIER
  else
    RSpec::Support.warning_notifier = RSpec::Support::DEFAULT_WARNING_NOTIFIER
  end
end