@@ -594,18 +594,28 @@ def what
594
594
it "handles scope" do
595
595
source = <<~RUBY
596
596
scope = 'special.events'
597
+ # These should be detected
597
598
t('scope_string', scope: 'events.descriptions')
598
599
I18n.t('scope_array', scope: ['events', 'titles'])
599
- I18n.t(model.key, **translation_options(model))
600
- I18n.t("success", scope: scope)
601
600
I18n.t("scope_array_symbol", scope: %i[events descriptions])
602
601
I18n.t("scope_array_words", scope: %w[events descriptions])
602
+
603
+ # Cannot handle, should ignore
604
+ I18n.t("scope_with_known_variable", scope: ["this", "that", scope])
605
+ I18n.t("scope_with_unknown", scope: ["this", "that", unknown, "other"])
606
+ I18n.t(model.key, **translation_options(model))
607
+ I18n.t("success", scope: scope)
603
608
RUBY
604
609
605
610
occurrences = process_string ( "scope.rb" , source )
606
611
607
612
expect ( occurrences . map ( &:first ) . uniq ) . to match_array (
608
- %w[ events.descriptions.scope_string events.titles.scope_array events.descriptions.scope_array_symbol events.descriptions.scope_array_words ]
613
+ %w[
614
+ events.descriptions.scope_string
615
+ events.titles.scope_array
616
+ events.descriptions.scope_array_symbol
617
+ events.descriptions.scope_array_words
618
+ ]
609
619
)
610
620
end
611
621
end
0 commit comments