Method: Mocha::Configuration#stubbing_method_unnecessarily=
- Defined in:
- lib/mocha/configuration.rb
#stubbing_method_unnecessarily=(value) ⇒ Object
Configure whether stubbing methods unnecessarily is allowed.
This is useful for identifying unused stubs. Unused stubs are often accidentally introduced when code is refactored.
When value
is :allow
, do nothing. This is the default. When value
is :warn
, display a warning. When value
is :prevent
, raise a StubbingError.
90 91 92 |
# File 'lib/mocha/configuration.rb', line 90 def stubbing_method_unnecessarily=(value) @options[:stubbing_method_unnecessarily] = value end |