Sha256: d21afb1e466ac816852969661a21c52d617bb64440ff64b9ba43dbe718e2fa6f

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

Stored size: 547 Bytes

Contents

module Mocha
  
  class Central
  
    attr_accessor :stubba_methods
  
    def initialize
      self.stubba_methods = []
    end
   
    def stub(method)
      unless stubba_methods.include?(method)
        method.stub 
        stubba_methods.push(method)
      end
    end
    
    def unstub(method)
      if stubba_methods.include?(method)
        method.unstub
        stubba_methods.delete(method)
      end
    end
    
    def unstub_all
      while stubba_methods.any? do
        unstub(stubba_methods.first)
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/mocha-0.9.12/lib/mocha/central.rb
mocha-0.9.12 lib/mocha/central.rb
mocha-0.9.11 lib/mocha/central.rb
mocha-0.9.10 lib/mocha/central.rb