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

      if !actual_exception
        pass new_message.raises_kind_of(expected_class)
      elsif !actual_exception.is_a?(expected_class)
        if expected_message && !(actual_message.to_s =~ %r[#{expected_message}])
          pass new_message.raises_kind_of(expected_class).
            with_message(expected_message)
        else
          pass new_message.raises_kind_of(expected_class)
        end
      else
        message = new_message.expected_to_not_raise_kind_of(expected_class)

        if expected_message
          fail message.with_message(expected_message).but.
            raised(actual_exception.class).
            with_message(actual_exception.message)
        else
          fail message
        end
      end
    end
def devaluate(actual_exception, expected_class, expected_message=nil)
      actual_message = actual_exception && actual_exception.message

      if !actual_exception
        pass new_message.raises_kind_of(expected_class)
      elsif !actual_exception.is_a?(expected_class)
        if expected_message && !(actual_message.to_s =~ %r[#{expected_message}])
          pass new_message.raises_kind_of(expected_class).
            with_message(expected_message)
        else
          pass new_message.raises_kind_of(expected_class)
        end
      else
        message = new_message.expected_to_not_raise_kind_of(expected_class)

        if expected_message
          fail message.with_message(expected_message).but.
            raised(actual_exception.class).
            with_message(actual_exception.message)
        else
          fail message
        end
      end
    end
evaluate
 (see Riot::AssertionMacro#devaluate)
 @param [Class] expected_class the unexpected Exception class
 @param [String, nil] expected_message an optional exception message or message partial