Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nullify_if_blank_matcher.rb « matchers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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