2014-02-19 11:07:50 -08:00
|
|
|
'use strict';
|
|
|
|
|
2014-03-08 13:42:08 -08:00
|
|
|
var chai = chai || require('chai');
|
|
|
|
var bitcore = bitcore || require('../bitcore');
|
2014-02-19 11:07:50 -08:00
|
|
|
|
|
|
|
var should = chai.should();
|
|
|
|
|
2014-03-10 11:00:25 -07:00
|
|
|
var PeerManagerModule = bitcore.PeerManager || require('./PeerManager');
|
2014-03-08 13:42:08 -08:00
|
|
|
|
2014-02-19 11:07:50 -08:00
|
|
|
var PeerManager;
|
|
|
|
|
|
|
|
describe('PeerManager', function() {
|
|
|
|
it('should initialze the main object', function() {
|
|
|
|
should.exist(PeerManagerModule);
|
|
|
|
});
|
|
|
|
it('should be able to create class', function() {
|
2014-03-05 11:11:16 -08:00
|
|
|
PeerManager = PeerManagerModule;
|
2014-02-19 11:07:50 -08:00
|
|
|
should.exist(PeerManager);
|
|
|
|
});
|
|
|
|
it('should be able to create instance', function() {
|
|
|
|
var pm = new PeerManager();
|
|
|
|
should.exist(pm);
|
|
|
|
});
|
|
|
|
it('should be able to start instance', function() {
|
|
|
|
var pm = new PeerManager();
|
|
|
|
pm.start.bind(pm).should.not.throw();
|
|
|
|
});
|
|
|
|
it('should be able to stop instance', function() {
|
|
|
|
var pm = new PeerManager();
|
|
|
|
pm.start();
|
|
|
|
pm.stop.bind(pm).should.not.throw();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|