def evaluate(actual_exception, expected_class, expected_message=nil)
      actual_message = actual_exception && actual_exception.message

      if !actual_exception
        fail new_message.expected_to_raise_kind_of(expected_class).but.raised_nothing
      elsif !actual_exception.is_a?(expected_class)
        fail new_message.expected_to_raise_kind_of(expected_class).not(actual_exception.class)
      elsif expected_message && !(actual_message.to_s =~ %r[#{expected_message}])
        fail expected_message(expected_message).for_message.not(actual_message)
      else
        message = new_message.raises_kind_of(expected_class)
        pass(expected_message ? message.with_message(expected_message) : message)
      end
    end
def evaluate(actual_exception, expected_class, expected_message=nil)
      actual_message = actual_exception && actual_exception.message

      if !actual_exception
        fail new_message.expected_to_raise_kind_of(expected_class).but.raised_nothing
      elsif !actual_exception.is_a?(expected_class)
        fail new_message.expected_to_raise_kind_of(expected_class).not(actual_exception.class)
      elsif expected_message && !(actual_message.to_s =~ %r[#{expected_message}])
        fail expected_message(expected_message).for_message.not(actual_message)
      else
        message = new_message.raises_kind_of(expected_class)
        pass(expected_message ? message.with_message(expected_message) : message)
      end
    end
(see Riot::AssertionMacro#evaluate)
 @param [Class] expected_class the expected Exception class
 @param [String, nil] expected_message an optional exception message or message partial