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 'spec/rubocop/cop/static_translation_definition_spec.rb')
-rw-r--r--spec/rubocop/cop/static_translation_definition_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/rubocop/cop/static_translation_definition_spec.rb b/spec/rubocop/cop/static_translation_definition_spec.rb
index 10b4f162504..9f45f6f8c5b 100644
--- a/spec/rubocop/cop/static_translation_definition_spec.rb
+++ b/spec/rubocop/cop/static_translation_definition_spec.rb
@@ -38,6 +38,15 @@ RSpec.describe RuboCop::Cop::StaticTranslationDefinition do
C = n_("c")
^^^^^^^ #{msg}
CODE
+ <<~'CODE',
+ A = _('a' \
+ ^^^^^^^ [...]
+ 'b')
+ CODE
+ <<~'CODE',
+ A = _("a#{s}")
+ ^^^^^^^^^^ [...]
+ CODE
<<~CODE,
class MyClass
def self.translations
@@ -100,6 +109,9 @@ RSpec.describe RuboCop::Cop::StaticTranslationDefinition do
'CONSTANT_1 = __("a")',
'CONSTANT_2 = s__("a")',
'CONSTANT_3 = n__("a")',
+ 'CONSTANT_var = _(code)',
+ 'CONSTANT_int = _(1)',
+ 'CONSTANT_none = _()',
<<~CODE,
class MyClass
def self.method