1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'mocha/central'

module Mocha
  
  module SetupAndTeardown
  
    def setup_stubs
      $stubba = Mocha::Central.new
    end
    
    def verify_stubs
      $stubba.verify_all { yield if block_given? } if $stubba
    end
  
    def teardown_stubs
      if $stubba then
        $stubba.unstub_all
        $stubba = nil
      end
    end

  end
end