Sha256: f37c475d67b9bf4160060b685f80e658694c9bc990597164a291cbbae027ce35
Contents?: true
Size: 412 Bytes
Versions: 6
Compression:
Stored size: 412 Bytes
Contents
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
6 entries across 6 versions & 1 rubygems