summaryrefslogtreecommitdiff
path: root/spec/support/matchers/nullify_if_blank_matcher.rb
blob: 8f6737499cc7b166177d352766ab03ca9fa01716 (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

RSpec::Matchers.define :nullify_if_blank do |attribute|
  match do |record|
    expect(record.class.attributes_to_nullify).to include(attribute)
  end

  failure_message do |record|
    "expected nullify_if_blank configuration on #{record.class} to include #{attribute}"
  end
end