summaryrefslogtreecommitdiffstats
path: root/test/lib/mocha/exception_raiser.rb
blob: 266e209a22cc625983c1fc8136d35c4ccadcdd6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Mocha # :nodoc:
  
  class ExceptionRaiser # :nodoc:
    
    def initialize(exception, message)
      @exception, @message = exception, message
    end
    
    def evaluate
      raise @exception, @exception.to_s if @exception == Interrupt
      raise @exception, @message if @message
      raise @exception
    end
    
  end
  
end