Sha256: acf0871a6609a90ddcb716b5ad3a176bc219328f97417dfec790ade2be01b0a5
Contents?: true
Size: 1.15 KB
Versions: 6
Compression:
Stored size: 1.15 KB
Contents
module Shoulda module Matchers module ActiveModel # @private module StrictValidator def allow_description(allowed_values) "doesn't raise when #{attribute} is set to #{allowed_values}" end def expected_message_from(attribute_message) "#{human_attribute_name} #{attribute_message}" end def formatted_messages [messages.first.message] end def messages_description if has_messages? ': ' + messages.first.message.inspect else ' no exception' end end def expected_messages_description(expected_message) if expected_message "exception to include #{expected_message.inspect}" else 'an exception to have been raised' end end protected def collect_messages validation_exceptions end private def validation_exceptions record.valid?(context) [] rescue ::ActiveModel::StrictValidationFailed => exception [exception] end end end end end
Version data entries
6 entries across 6 versions & 2 rubygems