# File lib/mocha/mockery.rb, line 138 138: def on_stubbing_method_on_non_mock_object(object, method) 139: if Mocha::Configuration.prevent?(:stubbing_method_on_non_mock_object) 140: raise StubbingError.new("stubbing method on non-mock object: #{object.mocha_inspect}.#{method}", caller) 141: end 142: if Mocha::Configuration.warn_when?(:stubbing_method_on_non_mock_object) 143: logger.warn "stubbing method on non-mock object: #{object.mocha_inspect}.#{method}" 144: end 145: end