Skip to content

Commit 38d6db7

Browse files
committed
Make sure that default aliases have Command and Cmd only stripped from beginning and end
1 parent 7eb23d4 commit 38d6db7

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/test/groovy/net/kautler/command/api/CommandTest.groovy

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,18 @@ class CommandTest extends Specification {
4646
testee.aliases == expectedAliases
4747

4848
where:
49-
testee || expectedAliases
50-
new Test1Command() || ['test1']
51-
new Test2Cmd() || ['test2']
52-
new TestThree() || ['testThree']
53-
new Test4() || ['test']
54-
new Test5() || ['test1', 'test2']
55-
new Test6() || ['Test1', 'Test2']
56-
new CommandTest7() || ['test7']
57-
new CmdTest8() || ['test8']
58-
new CommandTest9Cmd() || ['test9']
59-
new BaseCommand() { } || [testee.getClass().typeName[(testee.getClass().package.name.length() + 8)..-1].uncapitalize()]
49+
testee || expectedAliases
50+
new Test1Command() || ['test1']
51+
new Test2Cmd() || ['test2']
52+
new TestThree() || ['testThree']
53+
new Test4() || ['test']
54+
new Test5() || ['test1', 'test2']
55+
new Test6() || ['Test1', 'Test2']
56+
new CommandTest7() || ['test7']
57+
new CmdTest8() || ['test8']
58+
new CommandTest9Cmd() || ['test9']
59+
new CommandTestCmd10Cmd() || ['testCmd10']
60+
new BaseCommand() { } || [testee.getClass().typeName[(testee.getClass().package.name.length() + 8)..-1].uncapitalize()]
6061

6162
and:
6263
aliases = expectedAliases.size() == 1 ? 'alias' : 'aliases'
@@ -396,6 +397,8 @@ class CommandTest extends Specification {
396397
@RestrictionPolicy(NONE_OF)
397398
static class CommandTest9Cmd extends BaseCommand { }
398399

400+
static class CommandTestCmd10Cmd extends BaseCommand { }
401+
399402
static class BaseRestriction implements Restriction<Object> {
400403
@Override
401404
boolean allowCommand(CommandContext<?> commandContext) {

0 commit comments

Comments
 (0)