def devaluate(actual_exception, expected_class, expected_message=nil)
      actual_message = actual_exception && actual_exception.message
      if actual_exception.nil?
        pass new_message.raises(expected_class)
      elsif expected_class != actual_exception.class
        if expected_message && !(actual_message.to_s =~ %r[#{expected_message}])
          pass new_message.raises(expected_class).with_message(expected_message)
        else
          pass new_message.raises(expected_class)
        end
      else
        message = new_message.expected_to_not_raise(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
(see Riot::AssertionMacro#devaluate)
@param [Class] expected_class the unexpected Exception class
@param [String, nil] expected_message an optional exception message or message partial