Sha256: c53200bd6b0bd493d7b3a070a2a1ef07e9e6d4079b6486766334b5b59cff3cbe
Contents?: true
Size: 654 Bytes
Versions: 61
Compression:
Stored size: 654 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 verify_all(&block) unique_mocks.each { |mock| mock.verify(&block) } end def unique_mocks stubba_methods.inject({}) { |mocks, method| mocks[method.mock.__id__] = method.mock; mocks }.values end def unstub_all while stubba_methods.size > 0 method = stubba_methods.pop method.unstub end end end end
Version data entries
61 entries across 61 versions & 6 rubygems