debian-mirror-gitlab/tooling/danger/specs/match_with_array_suggestion.rb
2023-06-20 00:43:36 +05:30

17 lines
509 B
Ruby

# frozen_string_literal: true
require_relative '../suggestion'
module Tooling
module Danger
module Specs
class MatchWithArraySuggestion < Suggestion
MATCH = /(?<to>to\(?\s*)(?<matcher>match|eq)(?<expectation>[( ]?\[(?=.*,)[^\]]+)/
REPLACEMENT = '\k<to>match_array\k<expectation>'
SUGGESTION = <<~SUGGEST_COMMENT
If order of the result is not important, please consider using `match_array` to avoid flakiness.
SUGGEST_COMMENT
end
end
end
end