#293 Fix localized command losing its children

This commit is contained in:
ljacqu
2016-10-09 16:23:18 +02:00
parent 76e6d757da
commit 87f88cb32a
4 changed files with 21 additions and 2 deletions
@@ -92,6 +92,20 @@ public class HelpMessagesServiceTest {
assertThat(localCommand, sameInstance(command));
}
@Test
public void shouldKeepChildrenInLocalCommand() {
// given
CommandDescription command = TestCommandsUtil.getCommandWithLabel(COMMANDS, "authme");
// when
CommandDescription localCommand = helpMessagesService.buildLocalizedDescription(command);
// then
assertThat(localCommand.getChildren(), equalTo(command.getChildren()));
assertThat(localCommand.getDescription(), equalTo("authme cmd"));
assertThat(localCommand.getDetailedDescription(), equalTo("Main command"));
}
@Test
public void shouldGetTranslationsForSectionAndMessage() {
// given / when / then
@@ -7,6 +7,8 @@ section:
arguments: 'arg.'
commands:
authme:
detailedDescription: 'Main command'
authme.register:
description: 'Registration'
detailedDescription: 'Registers the player'