Class: Mocha::MockClass

Inherits:
Object show all
Extended by:
MockMethods
Includes:
MockMethods
Defined in:
lib/auto_mocha/mock_class.rb

Instance Attribute Summary

Attributes included from MockMethods

#stub_everything

Class Method Summary collapse

Methods included from MockMethods

expectations, expects, matching_expectation, method_missing, respond_to?, stubs, super_method_missing, unexpected_method_called, verify

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mocha::MockMethods

Class Method Details

.__new__Object



17
# File 'lib/auto_mocha/mock_class.rb', line 17

alias_method :__new__, :new

.inherited(subclass) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/auto_mocha/mock_class.rb', line 23

def inherited(subclass)
  subclass.class_eval do

    def self.new(*arguments, &block)
      __new__(*arguments, &block)
    end
  
  end

end

.new(*arguments, &block) ⇒ Object



19
20
21
# File 'lib/auto_mocha/mock_class.rb', line 19

def new(*arguments, &block)
  method_missing(:new, *arguments, &block)
end

.super_method_missing(symbol, *arguments, &block) ⇒ Object



13
14
15
# File 'lib/auto_mocha/mock_class.rb', line 13

def super_method_missing(symbol, *arguments, &block)
  superclass.method_missing(symbol, *arguments, &block)
end