Sha256: 175b1005e50da803340a2686a5c970502554681425b37ca90169a7965dff5f6a

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

RSpec::Matchers.define :be_a_complete_translation_of do |default_locale_filepath|
  extend I18nSpec::FailureMessage

  match do |filepath|
    locale_file = I18nSpec::LocaleFile.new(filepath)
    default_locale = I18nSpec::LocaleFile.new(default_locale_filepath)
    @misses = default_locale.flattened_translations.keys - locale_file.flattened_translations.keys
    @misses.empty?
  end

  failure_for_should do |filepath|
    "expected #{filepath} to include :\n- " << @misses.join("\n- ")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n-spec-0.6.0 lib/i18n-spec/matchers/be_a_complete_translation_of_matcher.rb