Skip to content

Commit

Permalink
Tests all conveyor belt functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebbishop committed Mar 28, 2016
1 parent 655e766 commit 1aad1d9
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions tests/server/models/gamelogic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,43 @@ describe ('Game Logic', function() {
})

});
describe('run express belts', function(){
describe('run belts', function(){
beforeEach(function(){
game.players[0].set('position', [9,5]); //mag 2, bearing s
game.players[1].set('position',[1,11]); //magnitude 1, bearing w
game.players[2].set('position', [7,7]);
game.runBelts(2);
})
it('should move players on express belts',function(){
expect(game.players[0].position.toObject()).to.eql([10,5]);
describe('run express belts', function(){
beforeEach(function(){
game.runBelts(2);
})
it('should move players on express belts',function(){
expect(game.players[0].position.toObject()).to.eql([10,5]);
});
it('should not move players on regular belts', function(){
expect(game.players[1].position.toObject()).to.eql([1,11]);
})
it('should not move players not on belts', function(){
expect(game.players[2].position.toObject()).to.eql([7,7]);
})
});
it('should not move players on regular belts', function(){
expect(game.players[1].position.toObject()).to.eql([1,11]);
})
it('should not move players not on belts', function(){
expect(game.players[2].position.toObject()).to.eql([7,7]);
})
})
describe('run all belts', function(){
beforeEach(function(){
game.runBelts(1);
})
it('should move players on express belts',function(){
expect(game.players[0].position.toObject()).to.eql([10,5]);
});
it('should ALSO move players on regular belts', function(){
expect(game.players[1].position.toObject()).to.eql([1,10]);
})
it('should not move players not on belts', function(){
expect(game.players[2].position.toObject()).to.eql([7,7]);
})
});
});


})
});

Expand Down

0 comments on commit 1aad1d9

Please sign in to comment.