Sha256: 0f4148c75c5d96f6604e8c4e8d6c97710171900b5b04b9b935794726ea42de57

Contents?: true

Size: 481 Bytes

Versions: 16

Compression:

Stored size: 481 Bytes

Contents

RSpec::Matchers.define :validate_timeliness_of do |attribute|
  match do |model|
    model._validators[attribute.to_sym].detect do |validator|
      validator.class == ActiveModel::Validations::TimelinessValidator &&
        validator.attributes.include?(attribute)
    end
  end

  failure_message do |_actual|
    "expect #{attribute} to validate timeliness of"
  end

  failure_message_when_negated do |_actual|
    "expect #{attribute} to not validate timeliness of"
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc10 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc9 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc8 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc7 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc6 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc5 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc4 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc3 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.rc1 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta12 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta11 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta10 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta9 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta8 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.0.pre.beta7 spec/support/matchers/validate_timeliness_of.rb