Skip to content

Commit

Permalink
Refactor to use a permission check in the TestGuideCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
md5sha256 committed Aug 11, 2024
1 parent e3cb2ee commit 4ca732f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static void unload() {
void testCommand(boolean op) {
Player player = server.addPlayer();
player.setOp(op);
boolean hasPermission = player.hasPermission("slimefun.command.guide");
server.execute("slimefun", player, "guide").assertSucceeded();

ItemStack guide = SlimefunGuide.getItem(SlimefunGuideMode.SURVIVAL_MODE);
Assertions.assertEquals(op, SlimefunUtils.containsSimilarItem(player.getInventory(), guide, true));
Assertions.assertEquals(hasPermission, SlimefunUtils.containsSimilarItem(player.getInventory(), guide, true));
}
}

0 comments on commit 4ca732f

Please sign in to comment.