class Codeclimate::Collectors::Messages::ConfigurationVerification

Used to emit the result of processing a Requests::VerifyConfiguration request

Constants

STATES

Private Instance Methods

validate_error_messages_are_strings() click to toggle source
# File lib/codeclimate/collectors/messages/configuration_verification.rb, line 21
def validate_error_messages_are_strings
  all_strs = (error_messages || []).all? { |m| m.is_a?(String) }
  unless all_strs
    errors.add(:error_message, "must be an array of strings")
  end
end
validate_error_messages_match_state() click to toggle source
# File lib/codeclimate/collectors/messages/configuration_verification.rb, line 28
def validate_error_messages_match_state
  if state == ERROR && error_messages.blank?
    errors.add(:error_messages, "are required if the state is 'error'")
  elsif state == SUCCESS && error_messages.present?
    errors.add(:error_messages, "should not be provided if config is valid")
  end
end