Example #1
0
  @Test
  public void cache_locales() {
    assertThat(jRubyI18n.getLocalesByRubyKey()).isEmpty();

    jRubyI18n.getLocale("fr");

    assertThat(jRubyI18n.getLocalesByRubyKey()).hasSize(1);
    assertThat(jRubyI18n.getLocalesByRubyKey().get("fr")).isNotNull();
  }
Example #2
0
  @Test
  public void shouldCacheLocales() {
    JRubyI18n i18n = new JRubyI18n(mock(I18n.class));
    assertThat(i18n.getLocalesByRubyKey().size(), Is.is(0));

    i18n.getLocale("fr");

    assertThat(i18n.getLocalesByRubyKey().size(), Is.is(1));
    assertThat(i18n.getLocalesByRubyKey().get("fr"), not(nullValue()));
  }