Class | Mocha::Configuration |
In: |
lib/mocha/configuration.rb
|
Parent: | Object |
Configuration settings
DEFAULTS | = | { :stubbing_method_unnecessarily => :allow, :stubbing_method_on_non_mock_object => :allow, :stubbing_non_existent_method => :allow, :stubbing_non_public_method => :allow } |
Allow the specified action (as a symbol). The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method.
# File lib/mocha/configuration.rb, line 14 14: def allow(action) 15: configuration[action] = :allow 16: end
Raise a StubbingError if the specified action (as a symbol) is attempted. The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method.
# File lib/mocha/configuration.rb, line 38 38: def prevent(action) 39: configuration[action] = :prevent 40: end
Warn if the specified action (as a symbol) is attempted. The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method.
# File lib/mocha/configuration.rb, line 26 26: def warn_when(action) 27: configuration[action] = :warn 28: end