コード例 #1
0
ファイル: JRubyI18nTest.java プロジェクト: ihr/sonarqube
  @Test
  public void cache_locales() {
    assertThat(jRubyI18n.getLocalesByRubyKey()).isEmpty();

    jRubyI18n.getLocale("fr");

    assertThat(jRubyI18n.getLocalesByRubyKey()).hasSize(1);
    assertThat(jRubyI18n.getLocalesByRubyKey().get("fr")).isNotNull();
  }
コード例 #2
0
ファイル: JRubyI18nTest.java プロジェクト: emeraldjava/sonar
  @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()));
  }