Class: Lookout::Mock
Overview
Object that doesn’t respond to anything except for what’s been explicitly defined on it and throws a mock error whenever it receives a method call.
Instance Method Summary collapse
Methods inherited from Stub
Constructor Details
This class inherits a constructor from Lookout::Stub
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (private)
15 16 17 18 19 20 21 22 23 |
# File 'lib/lookout-3.0/mock.rb', line 15 def method_missing(method, *args) raise Lookout::Reception::Error. from('%p#%s(%s)%s' % [self, method, Lookout::Inspect.args(*args), block_given? ? '{ … }' : ''], 1, 0..0) end |
Instance Method Details
#inspect ⇒ Object
6 |
# File 'lib/lookout-3.0/mock.rb', line 6 def inspect; 'mock' end |