Class: PactBroker::DB::ValidateEncoding

Inherits:
Object
  • Object
show all
Extended by:
Messages
Defined in:
lib/pact_broker/db/validate_encoding.rb

Class Method Summary collapse

Methods included from Messages

message, potential_duplicate_pacticipant_message, validation_message

Class Method Details

.call(connection) ⇒ Object



13
14
15
16
17
18
# File 'lib/pact_broker/db/validate_encoding.rb', line 13

def self.call connection
  encoding = connection.opts[:encoding] || connection.opts['encoding']
  unless encoding =~ /utf\-?8/i
    raise ConnectionConfigurationError.new(message('errors.validation.connection_encoding_not_utf8', encoding: encoding.inspect))
  end
end