debian-mirror-gitlab/spec/support/matchers/nullify_if_blank_matcher.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
312 B
Ruby
Raw Permalink Normal View History

2021-03-11 19:13:27 +05:30
# 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