Sha256: d11f78f0a397087d375228ffce3b235b93e320249c12f2e815c5ed2826e0d344
Contents?: true
Size: 525 Bytes
Versions: 25
Compression:
Stored size: 525 Bytes
Contents
require_relative 'suite' require 'hotch' require 'dry-validation' I18n.locale = :en I18n.backend.load_translations COUNT = ENV['COUNT'].to_i FIELDS = COUNT.times.map { |i| :"field_#{i}" } schema = Dry::Validation.Schema do configure do config.messages = :i18n end FIELDS.each do |field| required(field).filled(gt?: FIELDS.size / 2) end end data = FIELDS.reduce({}) { |h, f| h.update(f => FIELDS.index(f) + 1) } puts schema.(data).inspect Hotch() do 100.times do schema.(data).messages end end
Version data entries
25 entries across 25 versions & 1 rubygems