Sha256: 8c966f0ccad1c0cdf90a68acf5b0555ae0fc368945e7fad6ae677049730d3f4f

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

require 'mocha/mock_methods'

module Mocha

  class MockClass
  
    include MockMethods

    class << self
    
      include MockMethods
    
      def super_method_missing(symbol, *arguments, &block)
        superclass.method_missing(symbol, *arguments, &block)
      end
        
      alias_method :__new__, :new
  
      def new(*arguments, &block)
        method_missing(:new, *arguments, &block)
      end
        
      def inherited(subclass)
        subclass.class_eval do

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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mocha-0.3.0 lib/auto_mocha/mock_class.rb
mocha-0.2.0 lib/auto_mocha/mock_class.rb
mocha-0.1 lib/auto_mocha/mock_class.rb
mocha-0.3.1 lib/auto_mocha/mock_class.rb
mocha-0.1.2 lib/auto_mocha/mock_class.rb
mocha-0.2.1 lib/auto_mocha/mock_class.rb
mocha-0.1.1 lib/auto_mocha/mock_class.rb