|
| 1 | +var path = require('path') |
| 2 | +require('should') |
| 3 | + |
| 4 | +var BattlEye = require('../../lib/battleye.js') |
| 5 | +var Server = require('../../lib/server.js') |
| 6 | + |
| 7 | +var server = new Server(null, null, { |
| 8 | + battle_eye: true, |
| 9 | + battle_eye_password: 'password', |
| 10 | + battle_eye_port: '12345', |
| 11 | + title: 'BattlEye Server' |
| 12 | +}) |
| 13 | + |
| 14 | +describe('BattlEye', function () { |
| 15 | + describe('configContents()', function () { |
| 16 | + it('should include password', function () { |
| 17 | + var battlEye = new BattlEye({}, server) |
| 18 | + battlEye.configContents().should.containEql('RConPassword password') |
| 19 | + }) |
| 20 | + |
| 21 | + it('should include port', function () { |
| 22 | + var battlEye = new BattlEye({}, server) |
| 23 | + battlEye.configContents().should.containEql('RConPort 12345') |
| 24 | + }) |
| 25 | + |
| 26 | + it('should generate valid config contents', function () { |
| 27 | + var battlEye = new BattlEye({}, server) |
| 28 | + battlEye.configContents().should.eql('RConPassword password\nRConPort 12345') |
| 29 | + }) |
| 30 | + }) |
| 31 | + |
| 32 | + describe('configPath()', function () { |
| 33 | + it('should generate x64 config for arma 3 x64 server', function () { |
| 34 | + var battlEye = new BattlEye({ game: 'arma3_x64', path: '/' }, server) |
| 35 | + battlEye.configPath().should.eql(path.join('/', 'battleye', 'beserver_x64.cfg')) |
| 36 | + }) |
| 37 | + |
| 38 | + it('should generate regular config for arma3 server', function () { |
| 39 | + var battlEye = new BattlEye({ game: 'arma3', path: '/' }, server) |
| 40 | + battlEye.configPath().should.eql(path.join('/', 'battleye', 'beserver.cfg')) |
| 41 | + }) |
| 42 | + }) |
| 43 | +}) |
0 commit comments