Skip to content

Commit

Permalink
Rename topic player.inventory.item-equipped to player.inventory.equipped
Browse files Browse the repository at this point in the history
  • Loading branch information
dshaneg committed Mar 1, 2018
1 parent b4c3903 commit 5b8b600
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/commands/equip-item-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class EquipItemCommand implements Command {

execute(gameState: ReadOnlyGameState, publisher: EventPublisher, silent: boolean = false): void {
publisher.publish({
topic: 'player.inventory.item-equipped',
topic: 'player.inventory.equipped',
message: `You equip the ${this.item.name}.`,
voice: this.silent ? Voice.mute : Voice.gamemaster,
item: this.item
Expand Down
8 changes: 4 additions & 4 deletions src/test/commands/equip-item.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ describe('EquipItemCommand', () => {
mockito.verify(EventPublisherMock.publish(mockito.anything())).once();
});

it('Should call publisher player.inventory.item-equipped event.', () => {
it('Should call publisher player.inventory.equipped event.', () => {
command.execute(gameState, publisher);

const [event] = mockito.capture(EventPublisherMock.publish).first();
expect(event.topic).to.equal('player.inventory.item-equipped');
expect(event.topic).to.equal('player.inventory.equipped');
expect(event.message).not.to.be.empty;
expect(event.item).to.equal(item);
expect(event.voice).to.equal(Voice.gamemaster);
Expand All @@ -62,11 +62,11 @@ describe('EquipItemCommand', () => {
mockito.verify(EventPublisherMock.publish(mockito.anything())).once();
});

it('Should call publisher player.inventory.item-equipped event with mute voice.', () => {
it('Should call publisher player.inventory.equipped event with mute voice.', () => {
command.execute(gameState, publisher);

const [event] = mockito.capture(EventPublisherMock.publish).first();
expect(event.topic).to.equal('player.inventory.item-equipped');
expect(event.topic).to.equal('player.inventory.equipped');
expect(event.message).not.to.be.empty;
expect(event.item).to.equal(item);
expect(event.voice).to.equal(Voice.mute);
Expand Down

0 comments on commit 5b8b600

Please sign in to comment.