Class Mocha::Configuration
In: lib/mocha/configuration.rb
Parent: Object

Configuration settings.

Methods

Constants

DEFAULTS = { :stubbing_method_unnecessarily => :allow, :stubbing_method_on_non_mock_object => :allow, :stubbing_non_existent_method => :allow, :stubbing_non_public_method => :allow, :stubbing_method_on_nil => :prevent, }

Public Class methods

Allow the specified action.

@param [Symbol] action one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+. @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.

Raise a {StubbingError} if if the specified action is attempted.

@param [Symbol] action one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+. @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.

Warn if the specified action is attempted.

@param [Symbol] action one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+. @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.

[Validate]