### Question:
RuboCopRulesDefinition implements RulesDefinition { @Override public void define(Context context) { if (externalIssuesSupported) { RULE_LOADER.createExternalRuleRepository(context); } } RuboCopRulesDefinition(boolean externalIssuesSupported); @Override void define(Context context);  }### Answer:
@Test public void external_repositories_not_supported() { RulesDefinition.Context context = new RulesDefinition.Context(); RuboCopRulesDefinition rulesDefinition = new RuboCopRulesDefinition(false); rulesDefinition.define(context); assertThat(context.repositories()).isEmpty(); }
@Test public void rubocop_lint_external_repository() { RulesDefinition.Context context = new RulesDefinition.Context(); RuboCopRulesDefinition rulesDefinition = new RuboCopRulesDefinition(true); rulesDefinition.define(context); assertThat(context.repositories()).hasSize(1); RulesDefinition.Repository repository = context.repository("external_rubocop"); assertThat(repository.name()).isEqualTo("RuboCop"); assertThat(repository.language()).isEqualTo("ruby"); assertThat(repository.isExternal()).isEqualTo(true); assertThat(repository.rules().size()).isEqualTo(425); RulesDefinition.Rule rule = repository.rule("Lint/MultipleCompare"); assertThat(rule).isNotNull(); assertThat(rule.name()).isEqualTo("Multiple Compare (Lint)"); assertThat(rule.type()).isEqualTo(RuleType.CODE_SMELL); assertThat(rule.severity()).isEqualTo("MAJOR"); assertThat(rule.htmlDescription()).isEqualTo("<p>Use `&amp;&amp;` operator to compare multiple value.</p> " + "<p>See more at the <a href=\"https: assertThat(rule.tags()).isEmpty(); assertThat(rule.debtRemediationFunction().baseEffort()).isEqualTo("5min"); }