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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/cop/qa/selector_usage.rb')
-rw-r--r--rubocop/cop/qa/selector_usage.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/rubocop/cop/qa/selector_usage.rb b/rubocop/cop/qa/selector_usage.rb
index d615bd2926c..331c2c8a18b 100644
--- a/rubocop/cop/qa/selector_usage.rb
+++ b/rubocop/cop/qa/selector_usage.rb
@@ -20,14 +20,14 @@ module RuboCop
include QAHelpers
include CodeReuseHelpers
- SELECTORS = /\.qa-\w+|data-qa-\w+/.freeze
+ SELECTORS = /\.qa-\w+|data-qa-\w+/
MESSAGE = %(Do not use `%s` as this is reserved for the end-to-end specs. Use a different selector or a data-testid instead.)
def on_str(node)
return if in_qa_file?(node)
return unless in_spec?(node)
- add_offense(node, message: MESSAGE % node.value) if SELECTORS =~ node.value
+ add_offense(node, message: MESSAGE % node.value) if SELECTORS.match?(node.value)
rescue StandardError
# catch all errors and ignore them.
# without this catch-all rescue, rubocop will fail