2014-02-18 08:17:23 -08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var chai = require('chai');
|
|
|
|
var bitcore = require('../bitcore');
|
|
|
|
|
|
|
|
var should = chai.should();
|
|
|
|
|
|
|
|
var ConnectionModule = bitcore.Connection;
|
|
|
|
var Connection;
|
2014-02-18 08:22:27 -08:00
|
|
|
var nop = function() {};
|
2014-02-18 08:17:23 -08:00
|
|
|
|
|
|
|
describe('Connection', function() {
|
|
|
|
it('should initialze the main object', function() {
|
|
|
|
should.exist(ConnectionModule);
|
|
|
|
});
|
|
|
|
it('should be able to create class', function() {
|
|
|
|
Connection = ConnectionModule.class();
|
|
|
|
should.exist(Connection);
|
|
|
|
});
|
|
|
|
it('should be able to create instance', function() {
|
2014-02-18 08:22:27 -08:00
|
|
|
var mSocket = {server: null, addListener: nop},
|
|
|
|
mPeer;
|
2014-02-18 08:17:23 -08:00
|
|
|
var c = new Connection(mSocket, mPeer);
|
|
|
|
should.exist(c);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|