Skip to content

Commit

Permalink
Merge 0d9317e into 83aada8
Browse files Browse the repository at this point in the history
  • Loading branch information
manan19 committed Jun 19, 2014
2 parents 83aada8 + 0d9317e commit 8fd6ade
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test.Peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ describe('Peer', function() {
var p = new Peer('localhost', 8333);
should.exist(p);
});
it('should be able to create instance', function() {
var p = new Peer('localhost:8333');
should.exist(p);
});
it('should be able to create instance', function() {
var p = new Peer('localhost:8333');
var p2 = new Peer(p);
should.exist(p2);
});
it('should not be able to create instance', function() {
should.throw(function() {
new Peer(8333);
});
});
it('should be able to create instance', function() {
var p = new Peer('localhost', 8333);
p.toString().should.equal('localhost:8333');
});
it('check host as buffer', function() {
var p = new Peer('127.0.0.1', 8333);
p.getHostAsBuffer().toString('hex').should.equal('7f000001');
});
});


Expand Down

0 comments on commit 8fd6ade

Please sign in to comment.