Class: Mocks::Object

Inherits:
Mock show all
Includes:
BlankSlate
Defined in:
lib/mocks/object.rb

Instance Attribute Summary

Attributes inherited from Mock

#mock_calls

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BlankSlate

#blank_slate?, extended, included

Methods inherited from Mock

#initialize, #mock_add, #mock_args, #mock_calls_array, #mock_clear, #mock_freeze, #mock_recall, #mock_size

Methods included from Abstract

included

Constructor Details

This class inherits a constructor from Mocks::Mock

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



17
18
19
# File 'lib/mocks/object.rb', line 17

def method_missing ( meth, *args, &block )
  mock_add MethodCall.new(meth, *args, &block)
end

Class Method Details

.blank_slate_ignore(name) ⇒ Object



11
12
13
# File 'lib/mocks/object.rb', line 11

def self.blank_slate_ignore ( name )
  super or name =~ /^(mock_|nil\?$)/
end