class I18n::Backend::LazyLoadable

def assert_file_named_correctly!(file, translations)

The locale extracted from the path must be the single locale loaded in the translations.
Checks if a filename is named in correspondence to the translations it loaded.
def assert_file_named_correctly!(file, translations)
  loaded_locales = translations.keys.map(&:to_sym)
  expected_locale = LocaleExtractor.locale_from_path(file)
  unexpected_locales = loaded_locales.reject { |locale| locale == expected_locale }
  raise FilenameIncorrect.new(file, expected_locale, unexpected_locales) unless unexpected_locales.empty?
end