Method: Mocha::ClassMethods#any_instance
- Defined in:
- lib/mocha/class_methods.rb
#any_instance ⇒ Mock
Returns a mock object which will detect calls to any instance of this class.
47 48 49 50 51 52 53 |
# File 'lib/mocha/class_methods.rb', line 47 def any_instance if frozen? raise StubbingError.new("can't stub method on frozen object: #{mocha_inspect}.any_instance", caller) end @any_instance ||= AnyInstance.new(self) end |