Class: ActiveStorageValidations::Matchers::DurationValidatorMatcher

Inherits:
BaseComparisonValidatorMatcher show all
Includes:
ASVTimeoutable
Defined in:
lib/active_storage_validations/matchers/duration_validator_matcher.rb

Constant Summary

Constants included from ASVTimeoutable

ASVTimeoutable::UNSET

Instance Method Summary collapse

Methods included from ASVTimeoutable

#initialize_timeoutable, #timeout

Methods inherited from BaseComparisonValidatorMatcher

#between, #equal_to, #greater_than, #greater_than_or_equal_to, #less_than, #less_than_or_equal_to, #matches?

Methods included from ASVRspecable

#failure_message_when_negated, #initialize_rspecable

Methods included from ASVMessageable

#initialize_messageable, #with_message

Methods included from ASVExceptOnable

#except_on, #initialize_except_onable

Methods included from ASVContextable

#initialize_contextable, #on

Methods included from ASVAllowBlankable

#allow_blank, #initialize_allow_blankable

Constructor Details

#initialize(attribute_name) ⇒ DurationValidatorMatcher

Returns a new instance of DurationValidatorMatcher.



15
16
17
18
# File 'lib/active_storage_validations/matchers/duration_validator_matcher.rb', line 15

def initialize(attribute_name)
  super
  initialize_timeoutable
end

Instance Method Details

#descriptionObject



20
21
22
# File 'lib/active_storage_validations/matchers/duration_validator_matcher.rb', line 20

def description
  "validate file duration of :#{@attribute_name}"
end

#failure_messageObject



24
25
26
27
28
# File 'lib/active_storage_validations/matchers/duration_validator_matcher.rb', line 24

def failure_message
  message = [ "is expected to validate file duration of :#{@attribute_name}" ]
  build_failure_message(message)
  message.join("\n")
end