Sha256: aed7c3a39e8298f4d28f00f7321036b1a9e01a06b007721215276d10db3b2d69
Contents?: true
Size: 443 Bytes
Versions: 5
Compression:
Stored size: 443 Bytes
Contents
# frozen_string_literal: true RSpec::Matchers.define :allow_file_size do |size, validator, message| match do |model| value = double('file', size: size) allow_any_instance_of(model).to receive(:read_attribute_for_validation).and_return(value) dummy = model.new validator.validate(dummy) if message.present? dummy.errors.full_messages.exclude?(message[:message]) else dummy.errors.empty? end end end
Version data entries
5 entries across 4 versions & 2 rubygems