Sha256: 409079279a3652a7f9374265d41ce9c2a514a82ac65662e65d1a1628e5999a55

Contents?: true

Size: 512 Bytes

Versions: 143

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

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

143 entries across 143 versions & 1 rubygems

Version Path
renalware-core-2.0.110 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.109 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.108 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.106 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.105 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.104 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.103 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.102 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.101 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.100 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.99 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.98 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.97 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.96 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.95 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.94 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.93 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.92 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.91 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.90 spec/support/matchers/validate_timeliness_of.rb